Module:RegionMap
Jump to navigation
Jump to search
Documentation
Shows a map with the given region highlighted. If no parameter is given, {{pagename}} is used as single region.
Possible Regions
- Cragg's Island
- Dead Island
- Deep Island
- Derilect Ship
- Drayo's Cove
- Eastern Forest
- Eastern Plains
- Far's Peak
- Footpaw
- Frozen Fang
- Frozen Tooth
- Grand Hills
- Grand Peak
- Gulch of Lamentation
- Hidden Lake
- Northeast Shores
- Northern Plains
- Northern Shores
- Smuggler's Pass
- Southeast Shores
- Southern Islets
- Southern Jungle
- South Haven
- The Maw
- Weathertop
- Western Approach
- Western Coast
- Western Plains
- Whitesky Peak
Sea Regions
Sea NW | Sea NNW | Sea NNNW | Sea NNNE | Sea NNE | Sea NE |
Sea NWW | The Island | Sea NEE | |||
Sea NWWW | Sea NEEE | ||||
Sea SWWW | Sea SEEE | ||||
Sea SWW | Sea SEE | ||||
Sea SW | Sea SSW | Sea SSSW | Sea SSSE | Sea SSE | Sea SE |
Usage
{{RegionMap|size=|<Regions>}}
Parameter
- size: optional, default: '300px'
- opacity: optional, default: 0.5
Examples
{{RegionMap|The Maw|Hidden Lake}}
{{RegionMap|size=450px|opacity=0.9|Derilect Ship|Weathertop|Sea SW|Sea SSW}}
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