Installation

From Maps for MediaWiki
Revision as of 00:45, 30 July 2021 by Jeroen De Dauw (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This page is for wiki administrators that want to install the Maps extension. This is only possible with server access.

Installation[edit | edit source]

Maps is installed using Composer with MediaWiki's built-in support for Composer.

Step 1/2: composer update[edit | edit source]

On the command line, go to the base directory of your MediaWiki installation.

If you are using MediaWiki 1.35 or later and PHP 7.4 or later, run the following two commands:

COMPOSER=composer.local.json composer require --no-update mediawiki/maps:~9.0

composer update mediawiki/maps --no-dev -o

If you are using MediaWiki 1.35 or later with PHP 7.3, run the following two commands instead:

COMPOSER=composer.local.json composer require --no-update mediawiki/maps:~8.0

composer update mediawiki/maps --no-dev -o

If you are using an older version of MediaWiki or of PHP, then run these two commands instead:

COMPOSER=composer.local.json composer require --no-update mediawiki/maps:~7.0

composer update mediawiki/maps --no-dev -o

Step 2/2: modify LocalSettings.php[edit | edit source]

Add the following line to the end of your "LocalSettings.php" file:

wfLoadExtension( 'Maps' );

Verify installation success[edit | edit source]

Check the "Special:Version" page on your wiki. If it lists Maps, then installation was successful.

Configuration[edit | edit source]

Maps works out of the box without any configuration work being required. Below are some key configuration options that you might want to change. For a comprehensive overview of all settings, see the configuration overview.

Mapping service[edit | edit source]

The Maps extension supports displaying maps using multiple mapping services, including Google Maps, Leaflet and OpenLayers. At present the default is Leaflet, while in older versions of the extension it was Google Maps.

If you do not wish to use the default, use the $egMapsDefaultService configuration parameter. Examples:

  • For Google Maps:
    $egMapsDefaultService = 'googlemaps3';
    
  • For Leaflet:
    $egMapsDefaultService = 'leaflet';
    

When using Google Maps, you will need to provide your Google API key:

$egMapsGMaps3ApiKey = 'your-api-key';

Geocoding service[edit | edit source]

The Maps extension supports geocoding, the conversion of human readable addresses to coordinates. This is done via a webservice used for each map displayed on your wiki. By default Maps uses Nominatim. To use a different geocoding service, use the $egMapsDefaultGeoService.

$egMapsDefaultGeoService = 'google';

Alternative installation methods[edit | edit source]

Semantic Bundle[edit | edit source]

Maps is included in Semantic Bundle, an extension package build around Semantic MediaWiki. To install Maps via Semantic Bundle, follow the Semantic Bundle installation instructions rather than the ones on this page.

Installation without shell access[edit | edit source]

See https://www.mediawiki.org/wiki/Topic:Voivcvsg48plvx9u

This method is not officially supported.

Professional Hosting[edit | edit source]

The maintainers of the Maps extension provide commercial fully managed MediaWiki hosting.