Module:Infobox mapframe: Difference between revisions

From Random Island Wiki
Jump to navigation Jump to search
>Evad37
(default type)
>Evad37
(point, shape, and line)
Line 17: Line 17:
args.frame = "yes"
args.frame = "yes"
args.plain = "yes"
args.plain = "yes"
args.type = args.type or "point"
args["frame-width"] = args["frame-width"] or "270"
args["frame-width"] = args["frame-width"] or "270"
args.type = "point"
args.type2 = "shape"
args["stroke-width2"] = "3"
args["stroke-color2"] = "#00ff00"
args.type3 = "line"
if args.id then
args.id2 = args.id
args.id3 = args.id
end


local mapframe = mf._main(args)
local mapframe = mf._main(args)

Revision as of 21:19, 10 May 2018

Documentation for this module may be created at Module:Infobox mapframe/doc

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["frame-width"] = args["frame-width"] or "270"
	args.type = "point"
	args.type2 = "shape"
	args["stroke-width2"] = "3"
	args["stroke-color2"] = "#00ff00"
	args.type3 = "line"
	if args.id then
		args.id2 = args.id
		args.id3 = args.id
	end

	local mapframe = mf._main(args)
	return frame:preprocess(mapframe)
end

return p