Module:Infobox mapframe
Appearance
![]() | This module is rated as alpha. It is ready for third party input, and may be used on a few pages to see if problems arise, but should be watched. Suggestions for new features or changes in their input and output mechanisms are welcome. |
Usage
Module that automatically makes a mapframe suitable for an infobox automatically, if a page's linked Wikidata item has coordinates (अक्षांस-देशांतर लोकेशन (P625)). Otherwise, an empty string is returned.
Can be used from {{Infobox mapframe}}, or invoked directly by a template, or imported to another Lua module.
local mf = require('Module:Mapframe/sandbox')
local p = {}
p.main = function(frame)
local parent = frame.getParent(frame)
local parentArgs = parent.args
-- convert parent args to standard table
local args = {}
for k, v in pairs(parentArgs) do
args[k] = v
end
-- Some defaults/overrides for infobox presentation
args.display = "inline"
args.frame = "yes"
args.plain = "yes"
args.type = args.type or "point"
args["frame-width"] = args["frame-width"] or "270"
local mapframe = mf._main(args)
return frame:preprocess(mapframe)
end
return p