deformed-offering

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.

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 WXForum.net and Weather-Watch forums and saratogaWXPHP Twitter account as they become available.

This page was updated Wednesday, 21-Jul-2010 10:54 PM

Google mesomap display

The Affiliated Regional Weather Networks have been quite popular, and now it is possible for you to add a Google 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.

Here's a sample of the display:

Global Station Map of Affiliated Weather Networks

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

About the Global Map

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

Green 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).

Click on the home button in the map navigation controls to restore the map to the initial zoom level.
Click on the "Enable clustering" check box to toggle the clustering of stations display.

Affiliated Regional Weather Networks

1930 stations in affiliated networks worldwide as of 2013-05-21 15:03:21 UTC

Map data from Affiliated Regional Networks and scripts from Saratoga-Weather.org.
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.

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 :)..

Installation/Configuration

The map package (below) comes in 4 different basic configurations:

  • A HTML/JavaScript only package
  • A PHP/JavaScript package
  • A plugin for the WD/AJAX/PHP templates (USA, Canada, World - English only)
  • A plugin for the WD/AJAX/PHP multilingual templates (Canada-ML, World-ML)

A set of three JavaScripts (ClusterMarker.js, HtmlControl.js, and mapiconmaker.js) and an Icon set (./MESO-images/) are included with each configuration. To use any of the varieties on your personal weather website, you will need to acquire a Google Map API Key for your website. If you already have a Google Map API Key, you can reuse it for the script.

The PHP versions include two support scripts (get-links.php and global-conditions-json.php ) 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 plugin for the WD/AJAX/PHP multilingual templates (Canada-ML, World-ML) 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|Nets|Nets|
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|Weather|Weather|
langlookup|Enable clustering|Enable clustering|
langlookup|Conditions not available|Conditions not available|
langlookup|Temp|Temp|
langlookup|Hum|Hum|
langlookup|DewPT|DewPT|
langlookup|Baro|Baro|
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!

Replace the '-your-google-map-api-key-here-' in the main script with your Google Map API Key for your website. Then upload all files from your distribution.zip to your weather website (preserving the directory structure).

You can optionally adjust the initial center point and zoom level of the map by changing the line

map.setCenter(new GLatLng(0.0,-103.82946014), 1, G_NORMAL_MAP);

to have a different centerpoint lat/long and/or zoom level (1=max zoom out). For example,

map.setCenter(new GLatLng(44.71926117,-103.82946014), 3, G_NORMAL_MAP);

will set the map to show the USA and Canada at a nice zoom level.

In the PHP versions, if you see words like

Note: this file (name-of-file-here) has not been downloaded by script-name.php yet. Check permissions on the file to allow write all (666)

appearing, it simply means you need to set permissions on the named file so it is writable by PHP .. generally permissions of 666 will work.

Downloads

Download Updated
HTML-only .ZIP 20 Jul 2010 09:40pm PDT (21 Jul 2010 04:40 GMT)
PHP version .ZIP 20 Jul 2010 09:40pm PDT (21 Jul 2010 04:40 GMT)
WD/AJAX/PHP template
(USA, Canada, World) .ZIP
20 Jul 2010 09:40pm PDT (21 Jul 2010 04:40 GMT)
WD/AJAX/PHP ML template
(Canada-ML, World-ML) .ZIP
20 Jul 2010 09:40pm PDT (21 Jul 2010 04:40 GMT)

Version history

  • 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

Websites using the global-map scripts

48 global-map sites listed.

If you would like your site listed please contact me with your location and weather website URL.

deformed-offering