Template:Maps installation

From Mapping on MediaWiki
Revision as of 18:00, November 28, 2011 by Anno1404 (Talk | contribs)

Jump to: navigation, search

In order to use Maps, you need to have Validator installed. If you get a distribution from this page, you don't need to bother this, since Validator comes bundled with every release, and will automatically be loaded by Maps. If you get Maps from SVN trunk, or a tag, you must make sure you also get Validator.

Once you have downloaded the code, place the 'Maps' directory within your MediaWiki 'extensions' directory. Then add the following code to your LocalSettings.php file:

# Maps
require_once( "$IP/extensions/Maps/Maps.php" );

For using Google Maps or Yahoo! Maps, you must enter their API keys. You need to add them in LocalSettings.php, after the inclusion of Maps.

# API keys configuration
$egGoogleMapsKey = ""; # Your Google Maps API key. Required for displaying Google Maps, and using the Google Geocoder services.
$egYahooMapsKey = ""; # Your Yahoo! Maps API key. Required for displaying Yahoo! Maps.

If you don't already have them, you can obtain them at the Google Maps API page and Yahoo Maps API page. Note that the Google Maps API key is required for both displaying maps AND for geocoding (and therefore also required when you use display_address with a Yahoo! Map). Also note that use of the Google Maps API is free only if your site is accessible to the public; otherwise it costs money - read the Google Maps terms of service for further details.

Once you have successfully installed Maps, please add your wiki to the Sites that use Maps section.