-- This module implements the selection of the location map in and
-- Re-written to ensure values of the map_type parameter take precedence over the 'legacy' parameters alternative_location_map, force_national_map and use_lga_map.-- Also takes 'no' as a value in these legacy parameters to mean 'no' (the same as
require('strict')
local p =
local function isnotblank(s) return s and s ~= end
local function isnot_blankorno(s) if s
local statenames =
local mapwidths =
function p.main(frame) local largs = frame:getParent.args local place_type = (largs.type or ):lower local map_type = (largs.map_type or 'auto'):lower local state_abbr = (largs.state or ):lower local map_width = 270 local coords = largs.coordinates or local coordsa = largs.coordinates_a or local coordsb = largs.coordinates_b or local map_name if isnotblank(coords) or isnotblank(coordsa) then else map_type = 'nomap' end -- the valid normal values for map_type are 'national', 'australia', 'state', 'lga', 'nomap' and 'auto'.
if map_type
'australia' then map_name = 'Australia' elseif map_type
'lga' then map_name = 'Australia ' .. (statenames[state_abbr] or ) .. ' ' .. (largs.lga or ) map_width = mapwidths[state_abbr] or 270 elseif map_type
'auto' or map_type
'lga' then -- default for LGAs is no map map_type = 'nomap' else -- default for all other place types is the state map map_name = 'Australia ' .. (statenames[state_abbr] or ) map_width = mapwidths[state_abbr] or 270 end else -- map_type assumed to be a valid map name, or a series of valid map names separated by '#' map_name = largs.map_type -- getting it from the parameter again makes sure we have the original capitalisation map_type = 'altmap' end -- Build the map if map_type ~= 'nomap' then local caption = largs.pushpin_map_caption or if caption ~= then caption = '
' .. caption .. '
' end if isnotblank(coordsa) then -- a map for Infobox_Australian_road return frame:expandTemplate else -- a map for Infobox_Australian_place local relf = if isnot_blankorno(largs.relief) then relf = largs.relief end return frame:expandTemplate end end return end
return p