Jump to content

Module:Infobox mapframe/doc

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Evad37 (talk | contribs) at 04:41, 16 June 2020 (Usage: automatic maps in infoboxes). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Usage

Module that automatically makes a mapframe suitable for an infobox automatically, with minimal user input.

Generic usage

Just use the template {{Infobox mapframe}}, following the documentation there. This module may also be imported to another Lua module.

Automatic maps in infoboxes

Edit the infobox template (or its sandbox). Add the following lines to the infobox. Replace 4 with the appropriate number based on how many other image parameters are already present.

| image4     = {{#invoke:Infobox mapframe|auto}}
| caption4   = {{#invoke:Infobox mapframe|autocaption}}

If the template has a {{#invoke:Check for unknown parameters}}, add the following parameters:

| mapframe | mapframe_caption | mapframe_id | mapframe_coord | mapframe_wikidata | mapframe_shape | mapframe_frame-width | mapframe_frame-height | mapframe_shape-fill | mapframe_shape-fill-opacity | mapframe_stroke-color | mapframe_stroke-colour | mapframe_stroke-width | mapframe_marker | mapframe_marker-color | mapframe_marker-colour | mapframe_geomask | mapframe_geomask-stroke-color | mapframe_geomask-stroke-colour | mapframe_geomask-stroke-width | mapframe_geomask-fill | mapframe_geomask-fill-opacity | mapframe_zoom | mapframe_length_km  | mapframe_length_mi  | mapframe_area_km2  | mapframe_area_mi2 | mapframe_frame-coordinates | mapframe_frame-coord

Once this is done, the above parameters will be available to users of the template.

  • Defaults values for these parameters can also be specified in the #invoke calls above, e.g. {{#invoke:Infobox mapframe/sandbox|auto|marker=library}} means that the library marker will be used, unless a different value is passed in to the template.
  • The maps are off by default, which means maps will not be displayed unless |mapframe=yes is present in the template call. To turn maps on by default, in the #invoke calls above add |onByDefault=yes – which means maps will be displayed unless |mapframe=no is present in the template call. onByDefault can also be set to a conditional, such as if another parameters is present, e.g. |onByDefault={{#if:{{{pushpin_map|}}}|no|yes}}