Maps (MediaWiki extension): Difference between revisions

The educational technology and digital learning wiki
Jump to navigation Jump to search
Line 68: Line 68:
<source lang="bibtex">{{#display_map:Geneva, Switzerland|height=200px|width=400px|service=openlayers}}</source>
<source lang="bibtex">{{#display_map:Geneva, Switzerland|height=200px|width=400px|service=openlayers}}</source>


{{#display_map:Geneva, Switzerland,|service=openlayers}}
{{#display_map:Geneva, Switzerland|height=200px|width=400px|service=openlayers}}


=== Simple examples using multiple points ===
=== Simple examples using multiple points ===

Revision as of 18:24, 23 August 2013

Category:MediaWiki extension
Maps (MediaWiki extension)
Extension name Maps
About this article / disclaimer This is not official documentation
Logo Placeholder.png
Screenshot Placeholder.png
Location of the main author Gent, Belgium
Coordinates of the main authors 51.053829, 3.725012
Developers Jeroen De Dauw, others
Licences
Description Maps is a MediaWiki extension that provides the ability to visualize geographic data with dynamic, JavaScript based, mapping API's. It has built-in support for geocoding, displaying maps, displaying markers, adding pop-ups, and more.
Mediawiki requirements 1.17.* or higher for version 2.0, 1.21 alpha or higher or the 3.0 development version
Dependencies ParamProcessor
Related extensions (documented here) Semantic Maps
Related extensions
Discussion
Language support Many
Status
First release date 2009/07/01
Last release date (as of 2013/08/22!) 2013/08/01
Last version number 2.0.1 (stable, 12/2012), 3.0 (alpha)
Programming language PHP
Alternatives
Website home page
Publications
Support websites web site
Example websites http://semantic-mediawiki.org/wiki/Maps
Last edited 2013/08/22


Introduction

Maps is a MediaWiki extension that provides the ability to visualize geographic data with dynamic, JavaScript based, mapping API's such as Google Maps and OpenLayers in your wiki pages. It has built-in support for geocoding, displaying maps, displaying markers, adding pop-ups, and more. Maps allows extensive customization of your maps, either per map, or via a general setting affecting all maps on your wiki. It is used by the Semantic Maps extension. (Maps, retrieved Aug 2013.

Geocoding

Geocoding allows to work with addresses instead of coordinates, i.e. geocoding can convert something like 40 boulevard du Pont d'Arve, Geneva into coordinates.

Live example:

{{#geocode:40 bd du Pont-d'Arve, Genève}}
gives: 46° 11' 41.42" N, 6° 8' 24.91" E
{{#geocode:location=40 bd du Pont-d'Arve, Genève|format=float}}
gives: 46.194839 N, 6.140253 E
{{#geocode:location=40 bd du Pont-d'Arve, Genève|format=float|directional=no}}
gives: 46.194839, 6.140253

See more example in the official manual

Displaying Maps

In order to display map with one or more markers, you can either enter addresses that will be resolved by a geocoding service (see above) or coordinates.

One either can use a parser function or XML code.

Parser function:
{{#display_map:....}}
XML code:
<display_map>...</display_map>

Simple syntax example:

{{#display_map:<your location>|height=<some height>|service=<your service>|zoom=<zoom-level>}}

Read the official documentation, though there are new parameters which are not yet documented.

Simple examples

Most basic use example (result not shown):

{{#display_map:Genève}}
{{#display_map:}}

Below are some simple examples using height and width and zoom parameters.

{{#display_map:Geneva, Switzerland|height=200px|width=400px|zoom=8}}
Loading map...
{{#display_map:Geneva, Switzerland|height=200px|width=400px|service=openlayers}}
Loading map...

Simple examples using multiple points

Some addresses of University of Geneva (a city "campus")

{{
#display_map:
40 bd. du Pont-d'Arve,Geneva, Switzerland;
Rue du Général-Dufour 24, 1204 Genève;
Rue De Candolle 5, 1205 Genève;
Bd des Philosophes 22, 1205 Genève;
Rue de Saint-Ours 5, 1205 Genève;
Rue de Candolle 2, 1205 Genève;
Route de Drize 9, 1227 Carouge;
Rue Michel-Servet 1, 1206 Genève;
Rue Barthélemy-Menn 19, 1205 Genève;
Quai Ernest-Ansermet 24, 1205 Genève;
Quai Ernest-Ansermet 30, 1205 Genève
| height=200px|width=400px
}}
Loading map...

Google Maps layer map

(doesn't work, probably some configuration missing ...)

Loading map...

Installation and configuration

Installation

In order to install a bleeding edge 3.0 alpha version, we did the following in this wiki:

  • Upgrade PHP to 5.3.10 (i.e. the default in Ubuntu 12.04)
  • Upgrade both the Wiki and all SMW extensions to developer (alpha) code
cd extensions:
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/DataValues.git
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Validator.git
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Maps.git

Configuration

You can use Maps out of the box. However, some services require API keys and according configuration settings in LocaSettings.php.

Links