Help:Maps

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

Jump to: navigation, search

User manual

Introduction

Coordinates

Geocoding

Displaying maps

Displaying markers

Customizing markers

Mapping services

Semantic mapping

Coordinates data-type

Querying coordinate data

Distance query

Maps in forms

Admin manual

Maps enables you to display a map by using the #display_map parser function. Such a map will centre itself around a provided location, which can be a set of coordinates, or an address. In the later case, it will be automatically geocoded. You do not need to specify if the provided value is a set of coordinates or an address, this will be automatically determined.

The following code will result in a map of moscow.

{{#display_map: Moscow}}

Or

{{#display_map: 55°45′06″N 37°37′04″E}}

The above examples demonstrate the use of addresses and DMS coordinates. You can also use the other supported coordinate notations.

You can further customize your map by adding additional map properties.

Map properties

All map-display parser functions in Maps (display_map and display_point(s)) accept a number of map properties (also referred to as parameters). These properties can be altered to change the appearance and usage of the resulting map. Each property has a specific usage, as listed in the underneath table.

Both display_map and display_point(s) have a default property. This is the only value you can pass along without specifying the property name (like width=300). For display_map this is the coordinate or address representing the maps centre. For display_point(s) this is the list of points.

Some of the properties have aliases. This means they can be set using multiple names. An example for this is the center alias, which will have the exact same result as when using centre. All aliases are listed in the underneath table.

Property Usage Aliases Default Version
coordinates, address(es), 'nameless' Holds the maps centre for display_map or the list of points for display_point(s). Depending on which name you provide for this parameter, the values will be treated differently.
  • Default (nameless) parameter: Maps will determine if a value is a coordinate or not. When it isn't a coordinate, it'll be geocoded.
  • Coordinates: Maps will only accept valid coordinates, and reject all addresses.
  • Address(es): Maps will treat every value as an address, and geocode it, even when it's an address.
coords, location, locations configurable Changed in 0.4.2
service Allows to set the mapping service that will be used to generate the map. - configurable -
geoservice Allows to set the geocoding service used to turn addresses into coordinates in the display_map and display_point(s) parser functions. - configurable Added in 0.2
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.3
centre Allows to set the coordinates of the map's centre for display_point(s). Accepts both addresses and coordinates. When this property is not provided, the map will centre itself on the provided marker, or between the provided markers. center configurable or auto-detect Changed in 0.4
title Allows to set text that will be displayed in the pop-ups of all markers that do not have a specific title. When used together with label, the title will be bold and have a line under it. - empty Changed in 0.4
label Allows to set text that will be displayed in the pop-ups of all markers that do not have a specific label. - empty Changed in 0.4
icon Allows you to set the icon used for all markers. - Default mapping service marker Added in 0.5.2

Example of a Yahoo! Maps map with several optional parameters.

{{
#display_points:
service=yahoomaps
|address=Moscow, Russia; New York City
|zoom=7
|width=800
|height=500
}}

Since each mapping service has it's own unique features, they also have properties specific to them. See the relevant sub page of this article for the list of a service's specific properties.