FANDOM


local p = {}
function p.regionmap( f )
  local regions = f:getParent().args
  local size, opacity, map = '300px', 0.5, 'Map The Island.jpg'
  -- if regions are not given, take region from PAGENAME
  if regions == nil then
    regions = f.args[1]
  end
  local regionDivs = {}
  if regions.size ~= nil then
    size = regions.size
  end
  if regions.opacity ~= nil then
    opacity = regions.opacity
  end
  if regions.map ~= nil then
    map = regions.map
  end
 
  for _,region in ipairs(regions) do
    table.insert(regionDivs,'<div style="position:absolute">[[File:Region '..region..'.png|'..size..']]</div>')
  end
 
  return '<div class="noviewer" style="position: relative;width:'..size..';height:'..size..'"><div style="position:absolute">[[File:'..map..'|'..size..']]</div><div style="position:absolute;opacity:'..opacity..'">'..table.concat(regionDivs)..'</div></div>'
end
return p