Extension:GeoRSS

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

Release status: unknown

Georss-1.png
Implementation Tag, User interface
Description An easy geotagging interface, with GeoRSS syndication.
Author(s) Mikel Maron
Latest version 0.1
License No license specified
Download see below
Hooks used
EditFilter

EditPage::showEditForm:initial
ParserAfterTidy
UnknownAction

Translate the GeoRSS extension if possible

Check usage and version matrix; code metrics

The GeoRSS plugin introduces an easy interface for geotagging MediaWiki articles, and publishes a GeoRSS feed of all mapped articles in the Wiki, for mapping and syndication.

The extension has been deployed and is working well, but is in need of some care in packaging and clean up. That's the next step after initial posting here on mediawiki.org. Still, everything is documented below. Get in touch with me at mikel_maron yahoo com for anything related to this extension.

Files[edit | edit source]

GoogleMaps.php[edit | edit source]

GoogleMaps.php is based on Evan Miller's Extension:Google_Maps. Primarily the GeoRSS extension is borrowing the clever method of inserting a small editable Google Map into the GUI via Javascript. GeoRSS extension adds international city geocoding, and handles all storage of geotags without the user constructing any special wiki text. The design decision here is that all geotagging is through interaction with the map. This is accomplished by a bit more javascript, and pre and post editing hooks in the extension.

Place GoogleMaps.php in your extensions/ directory.
In LocalSettings.php

  • set $wgGoogleMapsKey to a key generated from here
  • add require_once("extensions/GoogleMaps.php");

DynamicPageList.php[edit | edit source]

DynamicPageList.php is based on m:DynamicPageList. The GeoRSS extension version adds support for outputting GeoRSS feeds.

Place DynamicPageList in your extensions/ directory.
In LocalSettings.php

  • add require_once("extensions/DynamicPageList.php");

Javascript, Scripts, and Images[edit | edit source]

Place all of the following in skins/gmaps/

  • mgeorss.js This is an extension to the Google Maps API that adds GeoRSS Parsing. More information here.
  • mgeocoder.2.js This is an extension to the Google Maps API that add international city geocoding. More information here.
  • mgeocoder.2.js requires a "proxy" to query the remote geocoder. There's a choice of versions in php, proxy.php, or perl, proxy.pl. Try the php version, which may only work on some system configurations; then try the perl version, making sure to change the reference to "proxy.php" to "proxy.pl" in mgeocoder.2.js.
  • 00BB00.png and EE8800.png are custom markers set in GoogleMaps.php. If you wish to use different markers, edit the code in GoogleMaps.php or replace these icons.

Setting up the GeoRSS feed[edit | edit source]

The GeoRSS feed is a special wiki page. Create a page with the name of your choosing (for example, "GeoRSSFeed"). Set the content of the page to ..

<DynamicPageList>
category=Mapped
mode=rss
</DynamicPageList>

.. and save. This page should only contain DynamicPageList but nothing else. Now add &action=xml to the url, and you will see the GeoRSS feed.

Any of the other DynamicPageList options are permitted, so for instance it's possible to set up a GeoRSS feed of Mapped pages in another particular category.

But I don't see a GeoRSS feed[edit | edit source]

The most common problem is that short urls are not enabled. The easiest solution is to Enabled Short URLs.

If Short Urls are not an option, then you'll need to be able to hack at the MediaWiki source. Add &action=xml to the url. This works fine for manual inspection, but when loaded by a map in the wiki (see next step), the "&" is urlencoded, and won't be properly parsed. The solution is to edit include/Wiki.php, in function performAction change

$action = $this->getVal('Action');

to

$action = $this->getVal('Action');
if (strpos($_SERVER{'QUERY_STRING'},'action=xml')) {
$action = 'xml';
}

Setting up a Map[edit | edit source]

Now you can add a map to any other wiki page, which will display all mapped pages in the GeoRSS feed.

<googlemap lat="15" lon="0" zoom="2" width="1000" height="500" rss1="/wiki/training/index.php/GeoRSS1?action=xml" rss2="/wiki/training/index.php/GeoRSS2?action=xml"> </googlemap>

The options:

  • lat, lon, zoom : the latitude, longitude, and zoom level of the map
  • width, height : width and height of the map
  • rss1, rss2 : the urls of the GeoRSS feeds to display. Only use "rss1" to display a single feed.

Suggestions & Ideas[edit | edit source]

Have any suggestions for future development of this plugin? Add them here.

  • Ability to add more info than just a link in the text box that pops up
  • Compatibility with GoogleMaps.php

Deployments[edit | edit source]