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

0 Members and 2 Guests are viewing this topic.

Offline tmabell

  • Senior Contributor
  • ****
  • Posts: 256
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: 7247
  • 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: 256
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: 7247
  • 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: 256
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: 156
    • 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: 7247
  • 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: 7247
  • 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: 256
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: 2135
    • 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: 363
    • http://www.TylerTexasWeather.Com
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: 7247
  • 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: 562
    • 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: 7247
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #13 on: Yesterday at 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: 156
    • Vermilion weather
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #14 on: Yesterday at 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: 562
    • Lake Huron Weather
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #15 on: Yesterday at 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: 2135
    • SouthEast Lincoln, NE Weather
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #16 on: Yesterday at 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: 302
    • Penn Lake Weather
Re: Curly's wxForecastMap.php google->leaflet?
« Reply #17 on: Today at 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.