Author Topic: Curly's wxForecastMap.php google->leaflet?  (Read 948 times)

0 Members and 1 Guest are viewing this topic.

Offline tmabell

  • Senior Contributor
  • ****
  • Posts: 267
Curly's wxForecastMap.php google->leaflet?
« 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.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7381
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #1 on: May 16, 2019, 12:24:34 PM »
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.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline tmabell

  • Senior Contributor
  • ****
  • Posts: 267
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #2 on: May 16, 2019, 12:33:39 PM »
Sent.  Thanks Ken!

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7381
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #3 on: May 16, 2019, 01:06:30 PM »
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).
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline tmabell

  • Senior Contributor
  • ****
  • Posts: 267
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #4 on: May 16, 2019, 01:14:44 PM »
I was hoping you would want to look at it!  As always, thank you very much!  =D>

Offline rrrick8

  • Senior Contributor
  • ****
  • Posts: 161
    • Vermilion weather
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #5 on: May 16, 2019, 10:14:24 PM »
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.
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7381
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #6 on: May 17, 2019, 01:04:08 AM »
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 :)

Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7381
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #7 on: May 18, 2019, 02:15:48 PM »
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
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline tmabell

  • Senior Contributor
  • ****
  • Posts: 267
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #8 on: May 18, 2019, 02:56:56 PM »
 =D>  Thanks Ken!! [tup]

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2203
    • SouthEast Lincoln, NE Weather
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #9 on: May 18, 2019, 03:08:28 PM »
Looks good, Ken.  It's working great here=D> \:D/ =D>

Many thanks! [tup]
Regards, Jerry Wilkins
gwwilk@inebraska.com

Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 372
    • Tyler Texas Weather
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #10 on: May 18, 2019, 04:08:05 PM »
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

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7381
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #11 on: May 18, 2019, 04:26:12 PM »
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.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Otis

  • (aka Paul)
  • Forecaster
  • *****
  • Posts: 578
    • Lake Huron Weather
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #12 on: May 18, 2019, 04:41:47 PM »
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>

Davis Vantage Pro2, Serial Data Logger
WD 10.37S-(b60), VWS V15.00p03, Weatherlink 6.0.3,  Fling 2.35, Broadwave 2.0, Win 7 Pro 64Bit
KMICHEBO10 - CW3699 - Cheboygan, MI

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7381
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #13 on: May 19, 2019, 08:03:01 PM »
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
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline rrrick8

  • Senior Contributor
  • ****
  • Posts: 161
    • Vermilion weather
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #14 on: May 19, 2019, 08:28:05 PM »
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.
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline Otis

  • (aka Paul)
  • Forecaster
  • *****
  • Posts: 578
    • Lake Huron Weather
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #15 on: May 19, 2019, 08:32:27 PM »
Nice addition, thanks again Ken.

Davis Vantage Pro2, Serial Data Logger
WD 10.37S-(b60), VWS V15.00p03, Weatherlink 6.0.3,  Fling 2.35, Broadwave 2.0, Win 7 Pro 64Bit
KMICHEBO10 - CW3699 - Cheboygan, MI

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2203
    • SouthEast Lincoln, NE Weather
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #16 on: May 19, 2019, 08:37:29 PM »
Nicely done, as usual, Ken!  Thanks for the addition which is up and running on my site.

 [tup]
Regards, Jerry Wilkins
gwwilk@inebraska.com

Offline yamiacaveman

  • Forecaster
  • *****
  • Posts: 307
    • Penn Lake Weather
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #17 on: May 20, 2019, 04:32:51 PM »
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.


Offline CNYWeather

  • Forecaster
  • *****
  • Posts: 2185
  • Yeah, I'm hugging my traffic light.
    • http://www.cnyweather.com
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #18 on: May 20, 2019, 04:54:48 PM »
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.
Tony




Offline yamiacaveman

  • Forecaster
  • *****
  • Posts: 307
    • Penn Lake Weather
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #19 on: May 20, 2019, 05:16:17 PM »
What a day Tony!!!!

If I would have pointed it to that page, I could have avoided asking the question.

Thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Offline rrrick8

  • Senior Contributor
  • ****
  • Posts: 161
    • Vermilion weather
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #20 on: May 20, 2019, 08:57:46 PM »
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
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline mikeym2m

  • Contributor
  • ***
  • Posts: 116
    • MikeyM's Thornhurst PA Weather
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #21 on: May 21, 2019, 10:06:33 AM »
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

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7381
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #22 on: May 21, 2019, 10:31:39 AM »
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'.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline rrrick8

  • Senior Contributor
  • ****
  • Posts: 161
    • Vermilion weather
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #23 on: May 21, 2019, 12:24:26 PM »
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

Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7381
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #24 on: May 21, 2019, 12:36:38 PM »
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.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

 

anything