Module:Mapframe/doc explained
On English Wikipedia, this module is called by, see that template's documentation for usage instructions.
Usage
- Standard usage:
Just use, which passes its parameters to this module's function as default.
If a page has a rendering time by Lua of between 5 seconds and 10 seconds using the use of the direct module call by syntax like: <nowiki>{{#tag:mapframe|[raw GeoJSON]|frameless=[1 for frame]|align=[left/right/center]|text=[caption]|width=[in px]|height=[in px]|latitude=[decimal degrees]|longitude=[decimal degrees]|zoom=[zoom factor]}}</nowiki>
saves Lua over-head. An example of this substitution is at https://en.wikipedia.org/w/index.php?diff=970846012. Such code minimises the chances of hitting the ten second Lua timeout if the back-end servers are busy.
- From another module:
- Import this module, e.g.
<nowiki>local mf = require('Module:Mapframe')</nowiki>
- Pass a table of parameter names/values to the function. See documentation for parameter names and descriptions. E.g.
<nowiki>local mapframe = mf._main(parameters)</nowiki>
- Preprocess 's output before returning it, e.g.
<nowiki>return frame:preprocess(mapframe)</nowiki>
Set up on another wiki
- Create template and module:
- Import this module and its template to that wiki (or copy the code over, giving attribution in the edit summary). Optionally, give them a name that makes sense in that wiki's language
- On Wikidata, add them to the items and
- Localise the module
- Edit the top bits of the module, between the comments
-- ##### Localisation (L10n) settings #####
and -- #### End of L10n settings ####
, replacing values between "
"
symbols with local values (when necessary)
- Add documentation
- to the template (e.g. by translating, adjusting as necessary per any localisations made in the previous step)
- to the module (please transfer/translate these instructions so that wikimedians who read your wiki but not the English Wikipedia can also set up the module and template on another wiki).