Weather Website Scripts

They're free, but use at your own risk

The scripts referenced here are used in the operation of this weather station, and may be freely copied and used to support your station. Please note that you use these scripts at your own risk. No warranty is expressed or implied. I accept no liability for any damages that may ensue from their use.
You will need to configure them for your own particular weather station website.
RSS feed for Scripts Updates A RSS Feed is available to help keep you informed on updates to the scripts.

Many of these scripts are now available on GitHub at

Buy Me A Coffee If you find one or more of the scripts useful to you, please consider making a donation to help offset the routine expenses of operation of this website.
Thanks for your kind support!

A Version History is available -- check back from time to time to see if there are updates to scripts you have downloaded earlier. Announcements of version updates and new scripts are made on and Weather-Watch forums and saratogaWXPHP Twitter account as they become available.

Note: Twitter widget has been disabled 3-Jul-2023 since it no longer displays the recent update Tweets.

This page was updated Monday, 25-May-2020 7:51 AM

Leaflet/OpenStreetMaps Global mesonet display

The Affiliated Regional Weather Networks have been quite popular, and now it is possible for you to add a Leaflet/OpenStreetMaps map display of conditions from around the world to your own website. We do prefer that the script(s) be used by members who contribute their data to a Regional Weather Network, but all are welcome to use this script set if they like.

Version 4.00 of the script set no longer requires an API key for map display. Support is provided for map tile displays if you have an Access Token, but 5 supplied maps are 'API key free'.

Here's a sample of the display:


Map is loading...
Temperature [ F° ] Dew Point [ F° ] Humidity [ % ] Wind [ mph ] Rain Today [ in ] Pressure [ inHg ]

[Weather, Webcam, Lightning] Weather, WebCam, Lightning, [Weather, Lightning] Weather, Lightning, [Weather, Webcam] Weather, WebCam, [Weather] Weather

This map shows the locations of current affiliated regional weather network member stations.

       Markers with numbers indicate clusters of stations - click to zoom the map to show station markers. If you click on a marker for a station, a descriptive window will open and show the station features, a link to the station's homepage, the regional network affiliations for the station, and current conditions at the station (where available).

Global mesonet-map script by

Regional Mesonets

Affiliated Regional Weather Networks

1108 stations in affiliated networks worldwide as of 2024-07-20 03:06:07 UTC

Map data from Affiliated Regional Networks and scripts from
If you have a personal weather station publishing to a personal weather website, you can submit a request to have your data included in this display by visiting the network for your geography from the list above.

Regional Networks created by along with the Global Afilliated Regional Networks hub site at [About]

Note: in the sample above, the network list links are NOT with target="_blank" to open in a new window/tab since this website is XHTML 1.0-Strict and that attribute is disallowed. The links in the popup windows for the markers are generated with target="_blank" since the validator cannot process JavaScript-generated HTML :)..


The map package (below) comes in one basic configuration:

  • A PHP map for standalone or a plugin for the Saratoga AJAX/PHP templates (V2 and V3 compatible)

The two support scripts (global-links.php and global-conditions-json.php ) are included to help minimize the access time to draw your map page by caching some files from the Affiliated Regional Weather Networks home site locally on your website. These files are:

  • network-list-inc.html
  • network-links-inc.html
  • member-count.txt
  • members-list-inc.html
  • global-conditions.json

Starter files of the above are included with the PHP distributions with content that lets you know that the cache file has not been written. Depending on your PHP installation, the above files may need to have permissions set to 666 (write/read by all) in order for the caching to work. If you do a 'view-source' on the PHP page with the scripts in it, it should show any error messages encoutered as HTML comments.

For the Saratoga multilingual templates, you may need to add to your language-LL-local.txt files the translations for:

langlookup|Global Station Map|Global Station Map|
langlookup|Global Station Map of Affiliated Weather Networks|Global Station Map of Affiliated Weather Networks|
langlookup|Weather, Lightning, WebCam|Weather, Lightning, WebCam|
langlookup|Weather, WebCam, Lightning|Weather, WebCam, Lightning|
langlookup|Weather, Lightning|Weather, Lightning|
langlookup|Weather, WebCam|Weather, WebCam|
langlookup|Conditions not available|Conditions not available|
langlookup|About the Global Map|About the Global Map|
langlookup|Affiliated Regional Weather Networks|Affiliated Regional Weather Networks|

Which will allow for the translation of the headings and pop-up station data boxes to language LL. You may also need to copy wxglobal-en.html to wxglobal-LL.html and translate the text inside from English to language LL so the rest of the page will display correctly. Be sure to use the correct character set for your page to match the other translation files used by the Multilingual templates. The multilingual plugin will also read the corresponding language-LL.js JavaScript so the conditions, wind-directions and barometric pressure trend can be translated in the popup conditions windows.
Note: if you create a translation for the multilingual template map, please let me know so I can include it in the global-map-template-ML distribution so others can use it too. Thanks in advance!

Version 4.00 now has configuration in one file global-map-settings.php. See the comments in that file to perform your own configuration.
See the global-map-README.txt file for more information about installation.
Also new in V4.00 are rotating conditions display under the station pins. This feature can be disabled in the configuration if you find it too 'busy' a display.


Download Updated
Standalone or Saratoga AJAX/PHP template
(USA, Canada, World) .ZIP
(V2 or V3 templates)
11 Feb 2019 04:03pm PST (12 Feb 2019 00:03 GMT)

Version history

  • Version 4.02 - 11-Feb-2019 - updated global-links.php V4.02, global-conditions-json.php V4.02 for HTTP/2 support
  • Version 4.01 - 12-Aug-2018 - updated global-map-lang-inc.php to use base64 decode before unserialize for $L language array (changed global-map-settings.php, global-map-inc.php)
    Fixed issue with station links in popup windows in global-map-genjs-inc.php
  • Version 4.00 - 12-Aug-2018 - rewrite to use Leaflet/OpenStreetMaps instead of Google Maps so no API key required.
  • Version 2.02 - 16-Jan-2017 - added fix for https Station URLs
  • Version 2.01 - 05-Jul-2016 - added support for required Google Map Browser JavaScript API key
  • Version 2.00 - 27-Nov-2013 - Rewritten for Google Maps API V3 and added selectable units controls for display.
  • Version 1.01 - 17-Nov-2013 - Google deprecated V2 of the Maps API so this script became non-operational. Replacement using V3 API underway.
  • Version 1.01 - 20-Jul-2010 - (html, php, template, template-ML) added ability to have links generated with target="_blank" and control for directory usage for cache files.
  • Version 1.00 - 17-Jul-2010 - Initial Release