require('strict')
local p =
local getArgs = require('Module:Arguments').getArgslocal locmap = require('Module:Location map')
local function switcherSeparate(s) if s
function p.container(frame, args, map) local caption_list = if not args then args = getArgs(frame,) end if not map then if args[1] then map = for mapname in string.gmatch(args[1], '[^#]+') do map[#map + 1] = locmap.getMapParams(mapname, frame) end if args['caption'] then if args['caption']
1 then map = map[1] end else map = locmap.getMapParams('World', frame) end end if type(map)
' .. table.concat(outputs) .. '
' else return locmap.top(frame, args, map) .. (args.places and args.places:gsub('%s*\n%s*', ) or ) .. locmap.bottom(frame, args, map) endend
local function manyMakeArgs(fullArgs, n) if n
function p.many(frame, args, map) if not args then args = getArgs(frame,) end if not args[1] then args[1] = 'World' end if not map then map = for mapname in string.gmatch(args[1], '[^#]+') do map[#map + 1] = locmap.getMapParams(mapname, frame) end if #map ~= 1 then local outputs = args.autoSwitcherLabel = true for k,v in ipairs(map) do outputs[k] = p.many(frame, args, v) end return '
' .. table.concat(outputs) .. '
' end map = map[1] end local marks = local markhigh if args.markhigh then mw.log('Removed parameter markhigh used.') local parent = frame:getParent if parent then mw.log('Parent is ' .. parent:getTitle) end mw.logObject(args, 'args') markhigh = true end for k, v in pairs(args) do -- @todo change to uargs once we have that if v then if string.sub(k, -4)
'lat' then k = tonumber(string.sub(k, 4)) if k then table.insert(marks, k) end elseif string.sub(k, 1, 11)
function p.load(frame, args, map) if not args then args = getArgs(frame,) end local dataModule = mw.loadData(args[1]) local containerArgs = dataModule.containerArgs if not map then map = for mapname in string.gmatch(containerArgs[1], '[^#]+') do map[#map + 1] = locmap.getMapParams(mapname, frame) end if #map ~= 1 then local outputs = args.autoSwitcherLabel = true for k,v in ipairs(map) do outputs[k] = p.load(frame, args, v) end return '
' .. table.concat(outputs) .. '
' end map = map[1] end local marks = if dataModule.marks then for k,markArgs in ipairs(dataModule.marks) do marks[k] = tostring(locmap.mark(frame, markArgs, map)) end end if dataModule.secondaryModules then for _,modname in ipairs(dataModule.secondaryModules) do for _,markArgs in ipairs(mw.loadData(modname).marks) do marks[#marks + 1] = tostring(locmap.mark(frame, markArgs, map)) end end end if args.autoSwitcherLabel then local TableTools = require('Module:TableTools') containerArgs = TableTools.shallowClone(containerArgs) containerArgs.autoSwitcherLabel = true end return locmap.top(frame, containerArgs, map) .. table.concat(marks) .. locmap.bottom(frame, containerArgs, map)end
return p