Editing
Module:Location map/info
From Thetacola Wiki
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
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;" |+ Location map of ]=] .. map.name .. '\n' .. [=[ |- ! name |colspan="3"| ]=] .. map.name .. [=[ |- ]=] if map.top then retval = retval .. [=[!rowspan="4"|border<br/>coordinates |- |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' .. [=[ |- ! map center |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' .. [=[ ! image |colspan="3"| <code>[[:File:]=] .. map.image .. '|' .. map.image .. [=[]]</code> |- |colspan="4"|[[File:]=] .. map.image .. [=[|400x400px]] |-]=] local i = 0 while map['image' .. (i+1)] or map['image' .. (i+2)] do i = i + 1 if map['image' .. i] then retval = retval .. '\n' .. [=[ ! image]=] .. i .. '\n' .. [=[ |colspan="3"| <code>[[:File:]=] .. map['image' .. i] .. '|' .. map['image' .. i] .. [=[]]</code> |- |colspan="4"|[[File:]=] .. map['image' .. i] .. [=[|400x400px]] |-]=] end 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
Summary:
Please note that all contributions to Thetacola Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Project:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Location map/info/doc
(
edit
)
Navigation menu
Page actions
Module
Discussion
Read
Edit source
History
Page actions
Module
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Search
Tools
What links here
Related changes
Special pages
Page information