CaseWiki:Google Map Extension
Contents |
[edit] About the Extension
The Google Maps API is the coolest thing sinced sliced bread. Combine this with the explosion of geographically tagged content on the web (see GeoURL) and you have a monster combo. Although this page is about an extension for MediaWiki, the JavaScript functions provided could be used by almost anyone looking to easily program the Google Maps API.
This extension is authored by Gregory Szorc <gregory.szorc@case.edu>.
[edit] How It Works
Like all MediaWiki extensions, this extension registers a tag with the parser. What makes it different and a little more complex than most is that most of the work occurs at run-time with Javascript.
Maps are embedded into pages by using the <gmap></gmap> tag. The PHP part of the extension will output a hidden form on the page containing the parameters for the map. At run time, Javascript looks at these parameters and decides what to do. See Help:Geo for the parameter listing.
The extension requires a bit more effort to install than other extensions because it requires modifying the MediaWiki skin files to include the Google Map source code. This is a trivial task on sites with only one skin, like this one. This problem is being addressed. The developer of this extension has filed bug reports with MediaWiki that request the features so modifying the skin files is not necessary. Once these are implemented, using this extension will be as simple as including a file in LocalSettings.php.
[edit] Recent Changes
- Fixed malicious injection possibility --Gregory.Szorc 13:31, August 19, 2005 (EDT)
- Can display a hybrid map --Gregory.szorc July 23, 2005 09:18 (EDT)
- Can optionally display type controls --Gregory.szorc July 23, 2005 09:18 (EDT)
- Map multiple RSS feeds on one map --Gregory.szorc 14:07, Jul 13, 2005 (EDT)
- Embed more than one map on a page --Gregory.szorc 13:45, Jul 13, 2005 (EDT)
[edit] See It In Action
- CaseWiki:Map -- a map of all geo-encoded entries in this wiki
- CaseWiki:Sandbox -- at time of this writing, it has 3 Google maps on it
[edit] Other Users
If you are using this extension or know of somebody who is, please post a comment on this site's talk page.
[edit] Installing This Extension
This extension is licensed under the GNU Lesser General Public License (LGPL).
[edit] Obtain Source Code
- JavaScript Source
- Extension Source
- XML Generator (for use with the GIS extension)
[edit] Google API Key
In order to embed a Google Map on any page, you need to obtain a Google Map API. This can be done at http://www.google.com/apis/maps/.
[edit] Include Source in Skin
The skin file for your wiki needs to be modified. It needs to include the necessary Google Map API (from google.com) as well as the aforementioned gmap.js file. An onLoad handler needs to be added so that renderMaps() is called after the page load.
