Module:Location map/info

local p = {}

function p.main(frame) local map = mw.loadData(string.gsub(mw.title.getCurrentTitle.prefixedText,'/doc$','')) local retval = [=[{| class="wikitable" style="text-align:center; margin-top:0;" ! name
 * + Location map of ]=] .. map.name .. '\n' .. [=[
 * colspan="3"| ]=] .. map.name .. [=[

]=]	if map.top then retval = retval .. [=[!rowspan="4"|border coordinates if map.right > 180 then retval = retval .. ' (' .. map.right - 360 .. ')' end retval = retval .. '\n' .. [=[ ! map center local width = (map.right - map.left) % 360 if width == 0 then width = 360 end local center = (map.left + width/2) % 360 if center >= 180 then center = center - 360 end retval = retval .. frame:expandTemplate{title = 'coord', args = { (map.top + map.bottom)/2, center }} retval = retval .. '\n' .. [=[	end if map.x then retval = retval .. '\n' .. [=[ ! x ! y	end retval = retval .. '\n' .. [=[ ! image if map.image1 then retval = retval .. '\n' .. [=[ ! image1 end if map.image2 then retval = retval .. '\n' .. [=[ ! image2 end if map.image3 then retval = retval .. '\n' .. [=[ ! image3 end if map.image4 then retval = retval .. '\n' .. [=[ ! image4 end if map.skew then retval = retval .. '\n' .. [=[ ! skew end if map.lat_skew then retval = retval .. '\n' .. [=[ ! lat_skew end if map.mark then retval = retval .. '\n' .. [=[ ! mark end if map.marksize then retval = retval .. '\n' .. [=[ ! marksize end retval = retval .. '\n|}' return retval end
 * colspan="3"| ]=] .. map.top .. '\n' .. [=[
 * style="width:7em;"| ]=] .. map.left .. '\n' .. [=[
 * style="width:7em;"| ]=] .. map.right
 * style="width:7em;"| ]=] .. map.left .. '\n' .. [=[
 * style="width:7em;"| ]=] .. map.right
 * style="width:7em;"| ]=] .. map.right
 * colspan="3"| ]=] .. map.bottom .. '\n' .. [=[
 * colspan="3"| ]=] .. map.bottom .. '\n' .. [=[
 * colspan="4"| ]=]
 * -]=]
 * colspan="3" style="overflow: auto; white-space: auto; width: 350px"| ]=] .. map.x .. '\n' .. [=[
 * colspan="3" style="overflow: auto; white-space: auto; width: 350px"| ]=] .. map.y .. '\n' .. [=[
 * -]=]
 * colspan="3"|
 * colspan="4"|]=] .. map.image .. [=[
 * -]=]
 * -]=]
 * colspan="3"|
 * colspan="4"|]=] .. map.image1 .. [=[
 * -]=]
 * -]=]
 * colspan="3"|
 * colspan="4"|]=] .. map.image2 .. [=[
 * -]=]
 * -]=]
 * colspan="3"|
 * colspan="4"|]=] .. map.image3 .. [=[
 * -]=]
 * -]=]
 * colspan="3"|
 * colspan="4"|]=] .. map.image4 .. [=[
 * -]=]
 * -]=]
 * colspan="3"| ]=] .. map.skew .. '\n' .. [=[
 * -]=]
 * colspan="3"| ]=] .. map.lat_skew .. '\n' .. [=[
 * -]=]
 * colspan="3"|
 * -]=]
 * colspan="3"| ]=] .. map.marksize .. '\n' .. [=[
 * -]=]

return p