Extension:Google Maps/Old versions

This is retained for historical purposes. Versions of Google Maps Extension described here are deprecated in favor of version.

Installing version 0.4 or 0.5
Version 0.5 works with MediaWiki 1.6 and later. Version 0.4 works with MediaWiki 1.5.

0. Get a Google Maps API key from. Be sure to enter a URL that will contain all wiki pages as sub-directories, e.g., http://wso.williams.edu/ or http://wso.williams.edu/wiki/.

1. Add this to the end of LocalSettings.php:

$wgGoogleMapsKey = "your key goes here"; require_once( "extensions/GoogleMaps.php" );

2. Download the appropriate file into the extensions folder:
 * GoogleMaps.php (version 0.5.5, for MediaWiki 1.6.x and 1.7.x) or
 * GoogleMaps.php (version 0.4.0, for MediaWiki 1.5.x)

Version 0.6
Version 0.6.0 is deprecated in favor of 0.7. It is compatible with MW 1.7 and up.

Version 0.6 adds a host of new features, including:
 * a pure-GUI map builder that must be seen to be believed: no need to learn the syntax!
 * enable/disable more map controls
 * colored paths, with a fancy color chooser
 * automatic distance calculation
 * draggable markers

However, these features come with a cost: installation is more of a pain. But, if you don't mind unzipping a file and tweaking a template file, you won't even notice.

Installation
0. Get a Google Maps API key from.

1. Add this to the end of LocalSettings.php:

$wgGoogleMapsKey = "your key goes here"; require_once( "extensions/ GoogleMaps/ GoogleMaps.php" ); # notice the new path

2. Change this line in includes/OutputPage.php:

$ret .= "\n";

To this:

$ret .= "\n";

Should be line 982 or so.

Change this line in skins/MonoBook.php:

text('lang') ?>" lang="text('lang') ?>" dir="text('dir') ?>">

To this:

text('lang') ?>" lang="text('lang') ?>" dir="text('dir') ?>">

Should be line 54 or so.

This is necessary for colored paths to work in Internet Explorer.

3. Now download this file, and unzip it into your "extensions" directory: http://wso.williams.edu/~emiller/GoogleMapsExtension-0.6.0.zip

It should create a "GoogleMaps" folder with a few files. If all went well, you should be good to go!

Compatibility
Version 0.4.0 of this extension has been test to work on the following browsers (please add to the list if this page shows a map under another browser/version/platform):
 * Mozilla 1.7.12 (Windows XP SP2)
 * SeaMonkey 1.0 (Windows XP SP2)
 * Internet Explorer 6.0 (Windows XP)
 * Firefox 1.5 (Mac, Windows XP, Linux [Debian Sarge Unstable/Testing])
 * Firefox 1.0 (Mac, Windows XP)
 * Opera 8.5 (Mac, Windows 98, Linux [Gentoo])
 * Safari 2.0 (Mac)
 * Camino 0.8 (Mac)

From Google Maps Extension 0.3.x
Note: If you're planning to upgrade MediaWiki anyway, you can just follow the installation instructions on your new copy of MediaWiki. However, you may still need to regenerate all of the maps on your site, so be sure to look at step #3 (below) after installation.

Below are instructions on upgrading your GoogleMapsExtension to version 0.4 from a previous version. Since version 0.4 does not require modifications to the skin files, we'll have to un-modify them first, then regenerate all our maps.

0. First, put the appropriate file into your extensions/ folder:
 * GoogleMaps.php (version 0.5.5, for MediaWiki 1.6.x), or
 * GoogleMaps.php (version 0.4.0, for MediaWiki 1.5.x)

1. Next, open up skins/MonoBook.php and remove these two lines from execute (line 49-ish):

global $wgGoogleMapsKey;

...

" type="text('jsmimetype') ?>">

2. Open up includes/Skin.php and remove this line from getHeadScripts (line 176-ish):

$r .= " \n";

Also, remove $wgGoogleMapsKey from the list of globals two lines above it.

3. If your parser cache is turned on (and it is by default; see $wgEnableParserCache for details), then you will need to regenerate all of the pages that had a map before you upgraded to Version 0.4. For each page that has a map, add "?action=purge" to the end of the page URL in your browser and press return. You might receive a prompt that says "Clear cache?" If so, press OK.

From Google Maps Extension 0.2.x or lower
First, follow the instructions for upgrading from 0.3.x.

Next, you'll need to change the zoom levels. In Version 1 of the Google Maps API, lower zoom numbers meant the map was closer up; but in Version 2, which Google Maps Extension 0.3 and later uses, lower zoom numbers mean the view is further away. To convert your old zoom numbers, use the formula:

newzoom = 17 - oldzoom

Just go through all of your existing maps, compute the new zoom number, and save.

Version history

 * 0.9.2 loads much faster on the edit page, uses a PNG image for browsers that do not support Google Maps, upgrades the search interface, and fixes several bugs.
 * 0.9.1 fixes a few bugs and adds the following translations: Arabic, Brazilian Portugese, Upper Sorbian, Luxembourgish, Norwegian, Portuguese, Slovak, Swedish, Tamil, Telugu, and Vietnamese.
 * 0.9.0 adds KML import and export, support for multi-line captions, mouse-over marker titles, a new "terrain" overlay, the ability to specify the opacity of paths and areas, and a Bulgarian translation.
 * 0.8.0 supports colored zones (polygons), adds a button to the edit page, allows zooming with the mouse wheel, fixes several bugs, has translations for Chinese and Russian, and includes several other features.
 * 0.7.7 fixes a crippling bug in 0.7.6
 * 0.7.6 supports continuous zooming, adds full support for French, and is more compatible with right-to-left languages
 * 0.7.5 fixes a couple more warnings, makes the Editor's map and the geo-coder optional, and adds full support for Dutch.
 * 0.7.4 fixes a couple of minor warnings some people were experiencing and adds full support for German.
 * 0.7.3 actually works in the absence of other extensions, fixing a dumb bug in 0.7.2.
 * 0.7.2 is fully compatible with other extensions such as Bad Behavior, Gallery2wiki, and Semantic Wiki; adds full support for Spanish and Catalan (thanks Anonymous!); and adds limited support for several other languages.
 * 0.7.1 fixes a bug that prevents the inset navigation control from showing, and it adds support for MediaWiki 1.5.
 * 0.7.0 has a better interface, a geo-coder, tabbed captions, support for multiple languages, custom markers, and hacker-friendly code


 * 0.5.4 fixes a bug that prevented the editor's map from working with the MonoBook skin.
 * 0.5.3 fixes a bug introduced in 0.5.2 that prevented compatibility with Safari.
 * 0.5.2 fixes a bug that prevented other extensions from using the "EditPage::showEditForm:initial" hook.
 * 0.5.1 has cleaner code than 0.5.0, but adds no new features or bug fixes.
 * 0.5.0 adds an editor's map into the "Edit" page. It is compatible only with MediaWiki 1.6.0 and later. See Editor's Map for details.

Version 0.4.0 (5/7/2006) makes several improvements:
 * Modifications to the skin files are no longer necessary
 * Each article can now contain more than one map
 * Calls to maps.google.com are only made on pages that actually have maps.

Version 0.3.0 (4/3/2006): All users are advised to upgrade to version 0.3.0 or later.
 * migrates to version 2 of the Google Maps API
 * patches a JavaScript injection vulnerability
 * fixes a memory leak in Internet Explorer.