Module:Mapframe/doc: Difference between revisions

Content deleted Content added
GeoJSON
 
(5 intermediate revisions by 4 users not shown)
Line 1:
{{Module rating |beta}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
{{High-use}}
{{Lua|Module:Transcluder}}
{{Uses TemplateStyles|Template:Maplink/styles-multi.css}}
On English Wikipedia, this module is called by {{tlx|Maplink}}, see that template's documentation for usage instructions.
== Usage ==
;Standard usage:
:Just use {{tl|Maplink}}, which passes its parameters to this module's {{mono|main}} function as default.
::If a page has a rendering time by Lua of between 5 seconds and 10 seconds using {{tl|Maplink}} the use of the direct module call by syntax like: <code><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></code> 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. <code><nowiki>local mf = require('Module:Mapframe')</nowiki></code>
Line 14 ⟶ 18:
# '''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 [[d:Q52554979{{wde|Q52554979]]}} and [[d:Q27882107{{wde|Q27882107]]}}
# '''Localise the module'''
#* Edit the top bits of the module, between the comments <code>-- ##### Localisation (L10n) settings #####</code> and <code>-- #### End of L10n settings ####</code>, replacing values between <code>"</code> <code>"</code> symbols with local values (when necessary)