amMap for MediaWiki
Thursday, August 4th, 2011For my worldwide Internet access project surfnext.com I developed an extension for MediaWiki to use amMap.
What is amMap?
amMap is a pretty cool Flash-based map which allows you to display geographical information. Check out the examples on amMap.com. It has been used on many pages world-wide, and now – thanks to SurfNext's needs – it is coming to MediaWiki!
What is MediaWiki?
It is the Wiki software which is behind Wikipedia and many other major wikis. SurfNext.com is also based on MediaWiki. Ah, the power of free software!
Why Flash, why amMap?
Because there is no free JavaScript-based map out there, which is not based on tiles. (Please post a link if you know any vector-based JavaScript map !!!)
Unfortunately iDevices (iPhone, etc) do not have Flash capabilities. Thus, you can't see the amMap on them.
Android has Flash support.
Download & Credits
Download version 0.5. (amMap v. 2.5.7 is included).
amMap requires you to leave the link to amMap (inside the map) intact, or to buy a commercial license.
I ask you to provide a back-link to my project SurfNext.com, if this extension is of value to you.
This extension is still in early beta, use at your own risk. Post comments about the extension on this blog page, thank you!
Installation
snAmmap requires MediaWiki 1.17 or higher, as it uses ResourceLoader. (Feel free to fork a version for earlier MediaWikis).
An alternative, of course, is to upgrade your Wiki. It is advisable, as the new release sports significant speed enhancements.
-
Put the snAmmap folder in your extensions folder.
-
Add require_once("$IP/extensions/snAmmap/snAmmap.php"); to your LocalSettings.php
-
If you want to, you can create custom data and settings files and put them somewhere in your Wiki installation path. (i.e. a folder custom)
Usage
Currently snAmmap only supports one map per page. After you have installed the extension, use the following tag in your Wiki where you want to include the map:
<ammap height="500px" width="500px" bgcolor="#FFFFFF" data_file="/custom/data.xml" settings_file="/custom/settings.xml">Placeholder text</ammap>
None of the tag's attributes are required, there are sensible defaults for them (falling back on the data_file and settings_file provided with amMap, for instance.)
-
height => sets the height of the map. Can be a percentage
-
width => sets the width. Can also be a percentage.
-
bgcolor => sets the initial background color, which can be modified in the settings file later.
-
data_file => sets the path (URL!) for the data_file. Can be a full URL with hostname, but you have to enable cross-site scripting, which is dangerous. Use a file from your server, preferably.
-
settings_file => sets the path for the settings_file
See the documentation of amMap for more details and information what you can modify.
Live Example
SurfNext.com uses the snAmmap extension on the main page in conjunction with custom data and settings files for a map which links to Wiki pages. It also has a dropdown menu from which you can select the individual countries by name, which also links to the Wiki pages.
SurfNext shows you how to obtain Internet access everywhere in the world. Feel free to join and participate!
Feel free to comment about SurfNext on this blog page.