Extension:Cargo/Other features

Displaying maps
Within templates that hold coordinates, it is usually not very helpful to simply display those coordinates; the vast majority of people will have no knowledge of where in the world a certain set of coordinates are. Rather, it is much preferable to display a map. For that, Cargo defines the parser function. It takes in coordinates, as well as a few optional parameters, and displays a map for that one point.

The parameters for  are:
 * - takes in a set of coordinates (mandatory).
 * - the mapping service used; can be  (for Google Maps) or   (for OpenLayers). OpenLayers is the default service.
 * - sets the zoom level. For both Google Maps and OpenLayers, the zoom level is an integer number between 1 and around 20, with higher numbers being more zoomed in. The default value for this parameter is 16 for both mapping services.
 * - sets the height of the map; the default value is 400px.
 * - sets the width of the map; the default value is 700px.

If you are using Google Maps, you may need to get an API key for it to work - once you get an API key, you should set it in LocalSettings.php via the "$wgCargoGoogleMapsKey" variable.

The standard usage of  is within a template, where   takes in a template parameter. However, it can be used to display hardcoded maps as well.

Lua support
You can call Cargo queries from within Lua modules defined by the Scribunto extension. To do that, just place something like the following code in a module: