WXforum.net
Web Weather => Weather Website PHP/AJAX scripting => Topic started by: tmabell on May 16, 2019, 12:19:28 PM
-
Ken, Any chance you could make the same change from Google Maps to Leaflet in Curly's old WxForecastMap.php script? I believe you have a copy but if not I do.
-
I don't seem to have a copy of that .. please send .zip to webmaster at saratoga-weather.org and I'll take a look.
-
Sent. Thanks Ken!
-
Thanks -- I've got it working on my test site. Cool little script.
The Leaflet conversion won't be an issue (fairly simple). The problem is it uses the forecast.weather.gov MapClick.php to get the data, and that functionality is to depart from the site when they do the forecast-v3 -> forecast implementation later this year.
Looks like the script will have to be rewritten to use the api.weather.gov JSON functionality instead of the MapClick.php XML capability.
I'll take a look at doing that (fun little project).
-
I was hoping you would want to look at it! As always, thank you very much! =D>
-
Agreed. I've been using Curly's script for quite some while. Help him Alpha and Beta test it.
Hope you have success with it Ken.
-
Been having fun with the conversion (rewrite) to produce it using Leaflet and the api.weather.gov JSON.
Attached is a sample image of the current output. I've got to tidy up the script a bit, then I'll let y'all whack on it :)
-
Ok folks, it's ready to have you kick-the-tires. I've attached V2.00 of NWS-forecast-map script which uses Leaflet maps and direct API requests to api.weather.gov (no cache files are used). It also uses the forecast images directly from api.weather.gov.
Try in a template site at https://saratoga-weather.org/wxtemplates/USA/wxforecastmap.php or native at https://saratoga-weather.org/wxtemplates/USA/NWS-forecast-map.php
-
=D> Thanks Ken!! [tup]
-
Looks good, Ken. It's working great here (https://www.gwwilkins.org/wxforecastmap.php)! =D> \:D/ =D>
Many thanks! [tup]
-
Ken,
Works great and looks great. Thanks very much.
One very minor correction you may want to make. In line 34 of NWS-forecast-map.php, you have "# put this in the CALLING page for quake-json.php script:".
Steve
-
Ahh.. cloning is a bit tricky (I borrow a lot from my prior code). Thanks for your sharp eyes.
I've established a GitHub repository for the script at https://github.com/ktrue/NWS-forecast-map so changes can be tracked. I'll likely put a scripts page on my site also. This has been a fun project.. thank y'all for suggesting it.
-
This is really nice Ken, makes a good addition to our sites. Thanks for this and everything else you do for us and this site. =D>
-
I just couldn't let the script go without porting some of the nws-alerts capability to it too..
Now V2.10 - 19-May-2019 will also pull the County Zone alerts (tend to have more activity than the Forecast Zone alerts), and if there are alerts, process them al la nws-alerts-details-inc (for the map polygons, if provided) and produce a red-outlined box with all the alerts shown. Mouse over an alert link to see a tooltip with the alert contents. Click the link to go to the NWS page with the alert.
Mouse over the alert polygon drawn on the map, and see a tooltip showing which alert is represented.
Here's a sample display attached, along with V2.10 of the script (only NWS-forecast-map.php and NWS-forecast-map.css have changed).
Best regards,
Ken
-
Well darn. Spent a few hours today implementing 2.0 into my website. Took a bit to find the proper places to make color changes I wanted. Now you go and do a brilliant thing like this.
J/k of course. Great work. I think I'll wait until tomorrow to work 2.1 onto the website.
-
Nice addition, thanks again Ken.
-
Nicely done, as usual, Ken! Thanks for the addition which is up and running on my site (https://www.gwwilkins.org/wxforecastmap.php).
[tup]
-
Hey Jerry,
To get it inside your template like you have it, do I have to use the new page template and add this page in or did i miss something? Most new stuff just always seems to open in the Saratoga template.
-
Hey Jerry,
To get it inside your template like you have it, do I have to use the new page template and add this page in or did i miss something? Most new stuff just always seems to open in the Saratoga template.
In the Zip the Ken provided, once you make the modifications to the NWS-forecast-map.php file, upload the whole shabang
from the ZIP file and you'll be all set. The wxforecastmap.php page in there takes care of the setup in the page for you.
-
What a day Tony!!!!
If I would have pointed it to that page, I could have avoided asking the question.
Thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
Have it implemented on my Forecast Page. Fantastic work Ken.
2 small items I'm looking at changing on it.
1) Would be putting a reset map to home button. Been running it through the paces with severe outbreak in southern plains but just refreshing the page does not return it to home, need to actually click menu link to Forecast Page to get it to return.
2) Have links to Warnings details open in new tab instead of current tab.
Minor items. Wonderful work Ken and it has performed admirably tonight with the high threshold of warnings in the plains.
=D> =D> =D>
http://vermilionweather.com/forecast.php
-
Ken
Working Great - Thanks [tup] http://mikeymsweather.com/wxforecastmap.php
Only think I dislike about the new NWS forecast is they show me "6 Miles WSW from Big Bass Lake, PA" when it used to be 3 Miles NW from Thornhurst". I know it has nothing to do with your script, but is a NWS issue.
Cheers
:-)
MikeyM
-
Have it implemented on my Forecast Page. Fantastic work Ken.
2 small items I'm looking at changing on it.
1) Would be putting a reset map to home button. Been running it through the paces with severe outbreak in southern plains but just refreshing the page does not return it to home, need to actually click menu link to Forecast Page to get it to return.
2) Have links to Warnings details open in new tab instead of current tab.
Minor items. Wonderful work Ken and it has performed admirably tonight with the high threshold of warnings in the plains.
=D> =D> =D>
http://vermilionweather.com/forecast.php
Good ideas... I'll add both to the script. The target="_blank" will be a settings option. The script generates XHTML1.0-Strict and that option on links is only valid on XHTML1.0-Transitional.
Thanks for the suggestions.
Ken
Working Great - Thanks [tup] http://mikeymsweather.com/wxforecastmap.php
Only think I dislike about the new NWS forecast is they show me "6 Miles WSW from Big Bass Lake, PA" when it used to be 3 Miles NW from Thornhurst". I know it has nothing to do with your script, but is a NWS issue.
Cheers
:-)
MikeyM
Glad it's working for you. The title/distance stuff is (as you say) all from the NWS (in the gridpoint forecast). I do display the direction/miles from place only if it's greater than 1 mile.. cuts down on the 'clutter'.
-
Have it implemented on my Forecast Page. Fantastic work Ken.
2 small items I'm looking at changing on it.
1) Would be putting a reset map to home button. Been running it through the paces with severe outbreak in southern plains but just refreshing the page does not return it to home, need to actually click menu link to Forecast Page to get it to return.
2) Have links to Warnings details open in new tab instead of current tab.
Minor items. Wonderful work Ken and it has performed admirably tonight with the high threshold of warnings in the plains.
=D> =D> =D>
http://vermilionweather.com/forecast.php
Good ideas... I'll add both to the script. The target="_blank" will be a settings option. The script generates XHTML1.0-Strict and that option on links is only valid on XHTML1.0-Transitional.
Thanks for the suggestions.
Ken
Working Great - Thanks [tup] http://mikeymsweather.com/wxforecastmap.php
Only think I dislike about the new NWS forecast is they show me "6 Miles WSW from Big Bass Lake, PA" when it used to be 3 Miles NW from Thornhurst". I know it has nothing to do with your script, but is a NWS issue.
Cheers
:-)
MikeyM
Glad it's working for you. The title/distance stuff is (as you say) all from the NWS (in the gridpoint forecast). I do display the direction/miles from place only if it's greater than 1 mile.. cuts down on the 'clutter'.
I'll throw one other thing out there for your consideration Ken. Like I posted earlier I was an alpha tester for Curly on this script and back then he had an option to save location from the map script. That was for users who are not in the same location as the website is being able to save their own location on the map. I can look through old messages from curly and see if I can find that if you are interested.
Sent from my SAMSUNG-SM-G928A using Tapatalk
-
Sure, send along Curly's older code for that.. I expect that some browser cookies are involved to save it as a user setting on the browser.
-
Sure, send along Curly's older code for that.. I expect that some browser cookies are involved to save it as a user setting on the browser.
PM sent.
-
Great job Ken as always! \:D/ . We're all very fortunate to have your skills and support. Thank you! =D>
Here is Indian Trail Weather, Hessville, NY https://indiantrailweather.com/wxforecastmap.php
-
Worked Great last night with the "Special Weather Statement", "Severe Thunderstorm Warning" and "Tornado Warning" correctly showing. [tup]
Thanks Ken
Cheers
:-)
MikeyM
-
Working great as usual Ken, some severe weather moving in and watches/warnings are working.
https://www.mckeanweather.com/mwCforecast.php
Had a nice little poke around that Leaflet site for the mapping, some interesting stuff...
Thanks again for all your work.
Brad
-
Hi Brad,
Nice restyling on the display of the WX-forecast-map script.
BTW.. you should replace your NEWN and MAWN network maps with the mesonet-map set of scripts.. the old *-mesomap.php set of scripts for the network stopped being supported on Sept. 1, 2016 -- https://saratoga-weather.org/scripts-mesonet-map.php for a copy that can display any regional network on a Leaflet map.
-
Thx Ken,
Love that 'border-radius', *grin*
Will get after the map this afternoon and see what I can come up with.
All the Best!
Brad