Author Topic: nws-alerts.php V1.43 with Leaflet/OpenStreetMap now available  (Read 1143 times)

0 Members and 1 Guest are viewing this topic.

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1526
    • Texas Weather
Re: nws-alerts.php V1.43 with Leaflet/OpenStreetMap now available
« Reply #25 on: May 28, 2019, 12:08:46 AM »
I added my (unused) mapbox api key.  Everything still looks the same.  Anybody want to share a link to their page that uses mapbox?  Thanks.

It will only show the map if the  alert includes location code. IE: It shows the map for an alert in Houston but not in Galveston and that's because the location code only came with the Houston alert.

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 591
    • LexMAWeather
Re: nws-alerts.php V1.43 with Leaflet/OpenStreetMap now available
« Reply #26 on: May 28, 2019, 08:15:45 AM »
Anyone can check out other map options... you do need a key for the Mapbox tiles.

Edit nws-alerts-config.php, around line 100 or so:

Code: [Select]
$mapProvider = 'Esri_WorldTopoMap'; // ESRI topo map - no key needed
//$mapProvider = 'OSM';     // OpenStreetMap - no key needed
//$mapProvider = 'Terrain'; // Terrain map by stamen.com - no key needed
//$mapProvider = 'OpenTopo'; // OpenTopoMap.com - no key needed
//$mapProvider = 'Wikimedia'; // Wikimedia map - no key needed
//
//$mapProvider = 'MapboxSat';  // Maps by Mapbox.com - API KEY needed in $mapboxAPIkey
//$mapProvider = 'MapboxTer';  // Maps by Mapbox.com - API KEY needed in $mapboxAPIkey

###   END OF SETTINGS   ###

Just un-comment (get rid of the leading "//") the line you want to try and upload the file. If you decide you don't like that, put the "//" back.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7497
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: nws-alerts.php V1.43 with Leaflet/OpenStreetMap now available
« Reply #27 on: May 28, 2019, 10:01:59 AM »
Ken:
I noticed in your posts here you mention MapBox is optional. I don't have an API Key for MapBox what happens if I don't have API key?

Thanks

A MapBox key just enables two additional maps, another Terrain and a Satellite map for display.  Totally optional, and if you donít have a key, the options for those additional map tiles will not be shown in the map type selection box.
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 tshattuck

  • Senior Contributor
  • ****
  • Posts: 271
    • Your Local Weather - Clay, NY
Re: nws-alerts.php V1.43 with Leaflet/OpenStreetMap now available
« Reply #28 on: May 28, 2019, 10:10:56 AM »
Ken:
Thanks for the clarification. It helps a lot.

Offline yamiacaveman

  • Forecaster
  • *****
  • Posts: 312
    • Penn Lake Weather
Re: nws-alerts.php V1.43 with Leaflet/OpenStreetMap now available
« Reply #29 on: May 28, 2019, 04:57:50 PM »
Hi Ken,

Just to be clear, the map will only show up when a warning is issued and the map does not show when a watch is issued. Or did I miss a setting?

yamiacaveman


pennlake.us

Offline mldenison

  • Senior Member
  • **
  • Posts: 80
    • York, PA Weather
Re: nws-alerts.php V1.43 with Leaflet/OpenStreetMap now available
« Reply #30 on: May 28, 2019, 05:51:32 PM »
It's working.  No map with Watch.  We're now under a Warning and the MapBox map shows up in the Warning.
Windows 7 x64
Weather PC: Intel NUC
Davis Vantage Pro 2
Weather Underground: KPAYORK30
York, PA Weather (Saratoga)
York, PA Weather (Leuven)

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7497
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: nws-alerts.php V1.43 with Leaflet/OpenStreetMap now available
« Reply #31 on: May 28, 2019, 06:08:01 PM »
In my experience with testing the scripts, the County Zone is the one that carries the geo info to outline on the map for Watch and Warning (not all Watches, though).  The Forecast Zone rarely caries geo info in my experience.  If an alert contains geo info, then the map will appear.. no geo info in the collection of alerts results in no map display with the detail page.
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 Jasiu

  • Forecaster
  • *****
  • Posts: 591
    • LexMAWeather
Re: nws-alerts.php V1.43 with Leaflet/OpenStreetMap now available
« Reply #32 on: May 28, 2019, 06:49:31 PM »
Some alerts that I've seen with geo info and the type of NWS code included:

  • Tornado Warning / county codes
  • Severe Thunderstorm Warning / county codes
  • Flash Flood Warning / county codes
  • Flood Warning / county and zone codes
  • Flood Advisory / county and zone codes
  • Special Weather Statement (not always) / zone codes

Offline yamiacaveman

  • Forecaster
  • *****
  • Posts: 312
    • Penn Lake Weather
Re: nws-alerts.php V1.43 with Leaflet/OpenStreetMap now available
« Reply #33 on: May 28, 2019, 09:49:38 PM »
Gotcha, thanks all.

 

anything