"ഘടകം:Location map" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം

Content deleted Content added
emergency fix - disable AlternativeMap when using the switcher. a better solution will come
proper fix - allow #-separated AlternativeMaps and overlay_images
വരി 402:
end
return builder:node(markOuterDiv(x, y, imageDiv, labelDiv))
end
 
local function switcherSeparate(s)
if s == nil then return {} end
local retval = {}
for i in string.gmatch(s .. '#', '([^#]*)#') do
i = mw.text.trim(i)
retval[#retval + 1] = (i ~= '' and i)
end
return retval
end
 
Line 423 ⟶ 433:
end
if type(map) == 'table' then
local altmaps = switcherSeparate(args.AlternativeMap)
if #altmaps > #map then
error(string.format('%d AlternativeMaps were provided, but only %d maps were provided', #altmaps, #map))
end
local overlays = switcherSeparate(args.overlay_image)
if #overlays > #map then
error(string.format('%d overlay_images were provided, but only %d maps were provided', #overlays, #map))
end
local outputs = {}
args.autoSwitcherLabel = true
args.AlternativeMap = nil
for k,v in ipairs(map) do
args.AlternativeMap = nilaltmaps[k]
args.overlay_image = overlays[k]
outputs[k] = p.main(frame, args, v)
end
"https://ml.wikipedia.org/wiki/ഘടകം:Location_map" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്