From Mapping on MediaWiki
Revision as of 07:59, March 31, 2010 by Jeroen De Dauw (Talk | contribs)

Jump to: navigation, search

User manual




Displaying maps

Displaying markers

Customizing markers

Mapping services

Semantic mapping

Coordinates data-type

Querying coordinate data

Distance query

Maps in forms

Admin manual

Semantic Maps provides the ability to aggregate coordinate data stored semantically via the Semantic MediaWiki extension by adding 'result formats' to it. This means that you are able to specify the mapping service you want to use with a parameter in an #ask query. If you do not know how #ask queries work, please read the manual. If you have any problems with your #ask queries in Semantic Maps, please try using the 'table' format instead of a mapping service to see which results are actually returned by your query.

One of the properties queried and displayed must be of type 'Geographic coordinate' for this query to work; this property is what will determine the location of each point on the map. Clicking on each point will display a label holding the name of the page, along with any other queried information; clicking on the page name will bring the user to that page.

You can find a list of all map properties you can set in #ask queries in the ask queries sub in the map properties section. You can find a list of all mapping services you can use with queries in the map services section.

The result formats provided by Semantic Maps can also be used in some extensions that extend Semantic MediaWiki's querying capabilities. The following list includes a few of them, but not all.

  • Semantic Compound Queries: Defines a parser function, #compound_query, that can make multiple Semantic MediaWiki queries at the same time.
  • Semantic Drilldown: Provides a page for drilling down into the category-based and semantic data of a site, using easily-created filters.

Querying non-coordinate data

Semantic Maps displaying a Google Maps map with Google Earth map type and a marker with pop-up representing queried data.

Semantic Maps supports the display of queried non-coordinate data. All queried properties that are not coordinates will be displayed in a pop-up balloon that will appear when clicking the marker representing the location of their corresponding coordinates. If there is a page associated with one of the non-coordinate values, the value will be linked to it.



This table contains all common map properties you can place in #ask queries.

Property Usage Aliases Default Version
format Allows to set the mapping service that will be used to generate the map. Do not use a 'service=' parameter for this, like in Maps. - configurable -
geoservice Allows to set the geocoding service used to turn addresses into coordinates. - configurable Added in 0.4.1
width Allows to set the width of the map, in pixels. - configurable -
height Allows to set the height of the map, in pixels. - configurable -
zoom Allows to set the zoom level of the map. When not provided and multiple markers are present on the map, the best fitting zoom will be taken, not the configurable default. - configurable or auto-detect Changed in 0.2
centre Allows to set the coordinates of the map's centre. When this parameter is not provided, the map will centre itself on the provided markers. center auto-detect Changed in 0.2
forceshow Enables you to force a map to be shown even when there are no query results. force show off Added in 0.5.1
showtitle Enables you to hide the title in the marker pop-ups. show title on Added in 0.5.2
template Allows you to define the content and it's layout of marker pop-ups. The template will receive the queried property values as nameless parameters ({{{1}}}, {{{2}}}, ect), and 3 named parameters: {{{title}}}, {{{latitude}}} and {{{longitude}}}. - none Added in 0.5.2
icon Allows you to set the icon used for all markers. - Default mapping service marker Added in 0.5.2
Semantic Maps showing queried data using a template for formatting.

This example demonstrates the use of properties and custom formatting using the template and showtitle parameters. (view demo's):

{{#ask: [[Category:City]]
| ?coordinates
| ?population 
| ?area#km²
| format=map
| width=800
| zoom=10
| template=City Popup
| showtitle=off
| icon=Blue_marker.png