မော်ဂျူး:Location map/info
Lua error in မော်ဂျူး:Documentation at line 144: message: type error in message cfg.container (string expected, got nil).
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;"
|+ ]=] .. map.name .. '\n' .. [=[ ၏ တည်နေရာပြ မြေပုံ
|-
! အမည်
|colspan="3"| ]=] .. map.name .. [=[
|-
]=]
if map.top then
retval = retval ..
[=[!rowspan="4"|အနားသတ်<br/>ကိုဩဒိနိတ်များ
|-
|colspan="3"| ]=] .. map.top .. '\n' .. [=[
|-
|style="width:7em;"| ]=] .. map.left .. '\n' .. [=[
| ←↕→
|style="width:7em;"| ]=] .. map.right
if map.right > 180 then
retval = retval .. ' (' .. map.right - 360 .. ')'
end
retval = retval .. '\n' .. [=[
|-
|colspan="3"| ]=] .. map.bottom .. '\n' .. [=[
|-
! မြေပုံဗဟိုချက်
|colspan="4"| ]=]
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
|colspan="3" style="overflow: auto; white-space: auto; width: 350px"| ]=] .. map.x .. '\n' .. [=[
|-
! y
|colspan="3" style="overflow: auto; white-space: auto; width: 350px"| ]=] .. map.y .. '\n' .. [=[
|-]=]
end
retval = retval .. '\n' .. [=[
! ပုံ
|colspan="3"| <code>[[:File:]=] .. map.image .. '|' .. map.image .. [=[]]</code>
|-
|colspan="4"|[[File:]=] .. map.image .. [=[|400x400px]]
|-]=]
if map.image1 then
retval = retval .. '\n' .. [=[
! ပုံ၁
|colspan="3"| <code>[[:File:]=] .. map.image1 .. '|' .. map.image1 .. [=[]]</code>
|-
|colspan="4"|[[File:]=] .. map.image1 .. [=[|400x400px]]
|-]=]
end
if map.image2 then
retval = retval .. '\n' .. [=[
! ပုံ၂
|colspan="3"| <code>[[:File:]=] .. map.image2 .. '|' .. map.image2 .. [=[]]</code>
|-
|colspan="4"|[[File:]=] .. map.image2 .. [=[|400x400px]]
|-]=]
end
if map.skew then
retval = retval .. '\n' .. [=[
! skew
|colspan="3"| ]=] .. map.skew .. '\n' .. [=[
|-]=]
end
if map.lat_skew then
retval = retval .. '\n' .. [=[
! lat_skew
|colspan="3"| ]=] .. map.lat_skew .. '\n' .. [=[
|-]=]
end
if map.mark then
retval = retval .. '\n' .. [=[
! mark
|colspan="3"| <code>[[:File:]=] .. map.mark .. '|' .. map.mark .. [=[]]</code>
|-]=]
end
if map.marksize then
retval = retval .. '\n' .. [=[
! marksize
|colspan="3"| ]=] .. map.marksize .. '\n' .. [=[
|-]=]
end
retval = retval .. '\n|}'
return retval
end
return p