Module:Location map: Difference between revisions
Jump to navigation
Jump to search
Per edit request
m (1 revision imported) |
Module:Location map>Pppery (Per edit request) |
||
Line 291: | Line 291: | ||
end | end | ||
local function markOuterDiv(x, y, imageDiv, labelDiv) | local function markOuterDiv(x, y, imageDiv, labelDiv, label_size) | ||
return mw.html.create('div') | return mw.html.create('div') | ||
:addClass('od') | :addClass('od') | ||
:addClass('notheme') | :addClass('notheme') -- T236137 | ||
:cssText('top:' .. round(y, 3) .. '%;left:' .. round(x, 3) .. '%') | :cssText('top:' .. round(y, 3) .. '%;left:' .. round(x, 3) .. '%;font-size:' .. label_size .. '%') | ||
:node(imageDiv) | :node(imageDiv) | ||
:node(labelDiv) | :node(labelDiv) | ||
Line 324: | Line 324: | ||
end | end | ||
local builder = mw.html.create('div') | local builder = mw.html.create('div') | ||
:cssText(' | :cssText('width:' .. label_width .. 'em') | ||
local distance = round(marksize / 2 + 1) | local distance = round(marksize / 2 + 1) | ||
if position == 'top' then -- specified top | if position == 'top' then -- specified top | ||
Line 494: | Line 494: | ||
local marksize = tonumber(args.marksize) or tonumber(map('marksize')) or 8 | local marksize = tonumber(args.marksize) or tonumber(map('marksize')) or 8 | ||
local imageDiv = markImageDiv(mark, marksize, args.label or mw.title.getCurrentTitle().text, args.link or '', args.alt, args[2]) | local imageDiv = markImageDiv(mark, marksize, args.label or mw.title.getCurrentTitle().text, args.link or '', args.alt, args[2]) | ||
local label_size = args.label_size or 91 | |||
local labelDiv | local labelDiv | ||
if args.label and args.position ~= 'none' then | if args.label and args.position ~= 'none' then | ||
labelDiv = markLabelDiv(args.label, | labelDiv = markLabelDiv(args.label, label_size, args.label_width or 6, args.position, args.background, x, marksize) | ||
end | end | ||
return builder:node(markOuterDiv(x, y, imageDiv, labelDiv)) | return builder:node(markOuterDiv(x, y, imageDiv, labelDiv, label_size)) | ||
end | end | ||