***closed*** weather34 for WeatherDisplay (clientraw and WDapi)

Just checked the conversion factor for my old w34 (V.3.4-X5(d)) page too: it was showing 110.6 mi instead of 59.8!

In the alerts.weather.gov version, would it be possible to have the ability to add multiple codes i.e. CAZ095 (Kern County Mountains) and CAC029 (Kern County) which is roughly the same area except the zone code CAZ095 could take in a larger area and parts of several counties? The reason being able to add multiple codes is that the NWS could issue an alert either for the zone or county depending on the type of alert and affected area. Another good example of this is in Kansas where the counties and zones are the same area.

Current Watches, Warnings and Advisories for Wyandotte (KSZ104) Kansas Issued by the National Weather Service (Wyandotte)
Current Watches, Warnings and Advisories for Wyandotte (KSC209) Kansas Issued by the National Weather Service (Wyandotte)

Hello Wim

Trying to add my links on the extras field.
I have added one of my own but nothing is appearing.The other links that were there are working ok.
Can you see any issue with the data i have entered ?

these are examples, please use your own ones

$frame = ‘Latest North Atlantic Synoptic Chart’;
$frm_ttls[$frame] = lang(‘Latest North Atlantic Synoptic Chart’); // name in menu
$frm_src[$frame] = ‘https://ocean.weather.gov/A_sfc_full_ocean_color.png’.$used_lang;
$frm_hgth[$frame] = 946; // name in menu

$frame = ‘BNLWN_mesonet’;
$frm_ttls[$frame] = lang(‘Benelux Weather Network’); // name in menu
$frm_src[$frame] = ‘http://www.beneluxweather.net/mesonet-map/mesonet-map.php?lang=’.$used_lang;
$frm_hgth[$frame] = 1366; // name in menu

$frame = ‘EWN_mesonet’;
$frm_ttls[$frame] = lang(‘European Weather Network’); // name in menu
$frm_src[$frame] = ‘https://www.weerstation-herent.be/ewn/stations.php?lang=’.$used_lang;
$frm_hgth[$frame] = 1500; // name in menu

Thanks
Steve

Change the link to:

$frm_src[$frame]        = 'https://ocean.weather.gov/A_sfc_full_ocean_color.png';

But even then it will not display, check in your browser: right-click => inspect => console
Refused to display ‘https://ocean.weather.gov/A_sfc_full_ocean_color.png’ in a frame because it set ‘X-Frame-Options’ to ‘sameorigin’
So you are not allowed to display those images in an iframe.
More and more websites do that as they do not want their content “copied”

Ok Wim thanks
Bit of a bummer but thanks for trying for me
Thanks.
Steve

I changed the scripts to also include plain images without an iframe.
Attached zip, replace two scripts but do not forget to make a copy of the current scripts first.
You can check the result at http://wd34.weather-template.com/pwsWD/w34_start_frame.php?frame=TEST

Wim


frames.zip (5.86 KB)

Ok Wim did what you said and looking good.

Any idea why the W34 part of my website won’t show on my ipad?

Getting message …Error: Embedded data could not be displayed.

Think it’s the code on my site. Not good at all with this stuff

Ps all shows ok on my laptop

steve

Google is your best friend => “Embed tag was never endorsed by the W3C so it’s invalid code, although some browsers support it.”
Safari is the engine on the iPad and more strict than others. Chrome on the iPad uses the Safari engine also.
When you redo your site with iframe it will work on all platforms.
Wim

Ok Wim Thanks
Will research it and try
Cheers

Hello Wim

Thx for the update of this nice layout.
I have it up and go, but i se on the right side on the current condition and push the link on “nearby” i get (EEBR , Brussel)

Did you het your METAR API key?
Wim

Ahhhhh sorry Wim, it’s on place i forgot to do that. Thx

Temp and Barometer block pop-up graphs for Y and M (not D) show "
Radiation" after the High/Low legend?


That is an unexpected/invalid translation in the language file for english
Add to the bottom of pwsWD/languages/lang.en.php 1 line just before the ?>

$lang['Good']= 'Good Air Quality ';

$lang['Low'] = 'Low';
?>

Wim

Thanks, Wim, all good now :slight_smile:

Wim, is there a way to force a page refresh when the page is loaded - I know I can click on the refresh button of my browser, but I would prefer to click on the link to my page and have that page loaded with fresh/up-to-date weather data (skipping any cache data).

As all data comes from PHP the browser cache will not be used for data as with html.
The server caches the data loaded from external sites. But those are not refreshed when reloading the page.
Actions when loading the page (as it is functioning now)

  1. Frame of the page with empty boxes is sent back to to the requesting browser
  2. The “update script” is loaded and it starts re-loading obsolete data form external sources (DarkSky, AQ, a.s.o.)
  3. All blocks are loaded one by one and they use the available data on the server, the blocks do not reload data themselves
  4. All blocks refresh their data at different intervals after they are loaded

Often one uses a cron-job so that all data on the server is always valid and step 2 just checks and find all data is OK.

Wim

A couple more observations on the Dark Theme viewed in Chrome. . .

  1. Your test page Sun block has a problem with “Estimated” font size - see Sun1. (I presume you have been making changes, as the block is no longer titled Sun, Moon & Space like mine - see Sun2. I prefer just Sun!)

  2. I think the webcam fits better at $webcam_height of 155px (webcam2) rather than 160px (webcam1, where it hangs over the bottom of the frame)? (I changed mine to show width 70%, too, to reproduce the 4:3 aspect ratio without stretching.)


Sun1.JPG

Sun2.JPG

webcam1.JPG

webcam2.JPG

Yes I am testing a new sun-block.php, it should always display the correct sun-position ,also when someone from another time-zone visits your site. That “Estimated” is only displayed in the “dark theme”. I removed it in the script as all text should be translated to the default language.

2. I think the webcam fits better at $webcam_height of 155px (webcam2) rather than 160px (webcam1, where it hangs over the bottom of the frame)? (I changed mine to show width 70%, too, to reproduce the 4:3 aspect ratio without stretching.)
The problem is not with the height the webcam image. The problem is a difference in the CSS between light and dark. All block-headers are displayed lower in the dark theme, just outside the band. In the light theme they are correctly place inside the grey band.
Have to find where it is specified.
Wim
FOUNDIT: weatheritem has 6px padding in dark 0px in light theme
There are more differences this pushes all content lower in the box.


Well done! I wonder why. . . (But that’s why my 5px correction made it “look” better!)