Page 1 of 1

Regional network mesonet-map.php updated V3.07

Posted: Fri 07 Apr 2017 7:25 pm
by saratogaWX
Recent changes in the Google Maps API for JavaScript caused an issue with the maps -- clicking on a cluster would cause all clusters to vanish, and the contained icons not displayed.

Version 3.07 fixes that issue (mainly in an updated mesonet-map.js file). Also, the mesonet-map.php and wxmesonetmap.php pages were changed to use https:// to load the Google Map script from the google site.

The MESO-images file has two new images (--.gif and ---sm.gif) to handle stations that have no wind direction in the reports.

The attached .zip has all the updates needed, or you can download the full package from here

Whew.. took me about 12 hrs of debugging the markerclusterer script to find the ONE line that need to be inserted to fix the issue.

Best regards,
Ken

Re: Regional network mesonet-map.php updated V3.07

Posted: Fri 07 Apr 2017 9:31 pm
by ConligWX
Hi Ken, Just updated with the file you uploaded, but lost the stations on my map. none are showing up. did something change?

https://www.conligwx.org/wxmesonetmap.php

also looks like my site has gone from the Current Conditions.

I'll try a full upload.

Re: Regional network mesonet-map.php updated V3.07

Posted: Fri 07 Apr 2017 11:15 pm
by saratogaWX
Your mesonet-map-json.php is returning the JSON with the markers and a PHP error message embedded
<br />
<b>Warning</b>: A non-numeric value encountered in <b>/share/CACHEDEV1_DATA/htdocs/weather/mesonet-map-common.php</b> on line <b>606</b><br />
and that is screwing up the JSON decode.

Line 606 in mesonet-map-common.php is

Code: Select all

$GUST = (float)($GUST * 0.44704); // mph -> m/s
so the $GUST value from one station is likely incorrect from the UKWN.

Try changing mesonet-map-common.php

Code: Select all

  if ($GUST <> '-') {
	if (!preg_match('|m/s|',$uomWind)) { // convert wind to meters-per-second
to

Code: Select all

  if ($GUST <> '-' and is_numeric($GUST)) {
	if (!preg_match('|m/s|',$uomWind)) { // convert wind to meters-per-second
to filter out those invalid gust values.. I found 4 stations in the UKWN with that issue.

Re: Regional network mesonet-map.php updated V3.07

Posted: Sat 08 Apr 2017 12:17 am
by ConligWX
Thanks I have done that but still no stations listed or my Site in the Current Conditions.

Line 757 error.

I changed 753 to:

Code: Select all

  if ($GUST <> '-' and is_numeric($GUST)) {
working now....

is this due to PHP 7.1.3 perhaps?

Also I did have redirect from http to https

but looks like mesonet does not like that. I had asked UKWN admin to see if https would work, but looks like he could not do it.

Re: Regional network mesonet-map.php updated V3.07

Posted: Sat 08 Apr 2017 9:24 pm
by dazza1223
hi just set up this but i cant see in on the map am i missing something here http://www.davisworthing.co.uk/maps/mesonet-map.php

Re: Regional network mesonet-map.php updated V3.07

Posted: Sun 09 Apr 2017 2:02 am
by saratogaWX
Seems to be working fine on your site now...

Re: Regional network mesonet-map.php updated V3.07

Posted: Sun 09 Apr 2017 2:29 am
by ConligWX
Its working only because of the changes, but I had to re-enable http for the UKWN to get my realtime.txt can WX networks not support https?

Re: Regional network mesonet-map.php updated V3.07

Posted: Sun 09 Apr 2017 4:07 am
by saratogaWX
Toxic17 wrote:Its working only because of the changes, but I had to re-enable http for the UKWN to get my realtime.txt can WX networks not support https?
The regional networks do support https:// access to the conditions data file, but does not support http://->https:// redirects. Just have Martin at ukwn.net change your station to use https:// to pull the data from your site.

Re: Regional network mesonet-map.php updated V3.07

Posted: Sun 09 Apr 2017 9:58 am
by dazza1223
ok how do i change the station to use https

Re: Regional network mesonet-map.php updated V3.07

Posted: Sun 09 Apr 2017 12:09 pm
by saratogaWX
dazza1223 wrote:ok how do i change the station to use https
If you mean 'change the UKWN to use HTTPS to pull my conditions', then use the contact form on the www.ukwn.net site to let Martin know the particulars and he can change it. It is NOT something you can change yourself.

If you mean 'how can I get my website to use HTTPS', then that's something to work with your website hoster. The mesonet-map scripts work well with either http: or https: hosting.

If it's something else you mean, then please elucidate :)

Re: Regional network mesonet-map.php updated V3.07

Posted: Mon 10 Apr 2017 10:38 pm
by ConligWX
saratogaWX wrote:
dazza1223 wrote:ok how do i change the station to use https
If you mean 'change the UKWN to use HTTPS to pull my conditions', then use the contact form on the http://www.ukwn.net site to let Martin know the particulars and he can change it. It is NOT something you can change yourself.
I have been in touch with Martin and he has managed to update the realtime.txt to my https url,

however he is unable to set my website (when you click on the popup over a site - mine being Conlig, Co. Down) to an https url as it removes the colon in the URL.

it ends up like so: http://https//www.conligwx.org/ then resolves to : https//www.conligwx.org/ which is not a correct formatted web address.

Re: Regional network mesonet-map.php updated V3.07

Posted: Mon 10 Apr 2017 10:52 pm
by saratogaWX
Ah... I'll contact Martin.. he needs an updated mesonet collector script (V3.00) to better handle http/https.

Best regards,
Ken

Re: Regional network mesonet-map.php updated V3.07

Posted: Tue 11 Apr 2017 8:27 am
by ConligWX
saratogaWX wrote:Ah... I'll contact Martin.. he needs an updated mesonet collector script (V3.00) to better handle http/https.

Best regards,
Ken
Thanks Ken, all now working correctly. :clap: