Extension:Google Maps/Old versions

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
Google Maps Extension

Release status: beta

Google Maps Extension Type Selector.jpg
Implementation Tag
Description Easily create maps populated with wiki-fied place markers.
Author(s) Evan Miller et al.
Last version see SVN (2012-01-23)
MediaWiki 1.5 and up
Database changes no
License GPL
Download SVN.zip zip file SVN.tar.gz tar ball (instructions)
Bugs: list open list all report

Google Maps Extension for MediaWiki

Introduction - Installation - Editor's Map - Syntax - Compatibility - Languages - Developers - Talk - Versions

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

Contents

Installing version 0.4 or 0.5 [edit]

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 [1]. 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:

Version 0.6 [edit]

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 [edit]

0. Get a Google Maps API key from [2].

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 .= "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"$wgContLanguageCode\" lang=\"$wgContLanguageCode\" $rtl>\n";

To this:

 $ret .= "<html xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"$wgContLanguageCode\" lang=\"$wgContLanguageCode\" $rtl>\n";

Should be line 982 or so.

Change this line in skins/MonoBook.php:

 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php $this->text('lang') ?>" lang="<?php $this->text('lang') ?>" dir="<?php $this->text('dir') ?>">

To this:

 <html xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php $this->text('lang') ?>" lang="<?php $this->text('lang') ?>" dir="<?php $this->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 [edit]

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)

Upgrading [edit]

From Google Maps Extension 0.3.x [edit]

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:

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

   global $wgGoogleMapsKey;

...

   <script src="http://maps.google.com/maps?file=api&v=2&key=<?php echo $wgGoogleMapsKey ?>" type="<?php $this->text('jsmimetype') ?>"></script>

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

   $r .= "<script src=\"http://maps.google.com/maps?file=api&v=2&key={$wgGoogleMapsKey}\" type=\"{$wgJsMimeType}\"></script>\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 [edit]

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 [edit]

  • 0.9.4 fixes a broken link on the list of Special pages, and fixes bugs related to undefined index errors, HTML validation, and KML import when the URL contains an ampersand.
  • 0.9.3 fixes bugs with PHP4 compatibility, KML export, and tabbed info balloons
  • 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.