Module:Infobox mapframe/doc
Appearance
![]() | This is a documentation subpage for Module:Infobox mapframe. It may contain usage information, categories and other content that is not part of the original module page. |
Related pages |
---|
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}}