Module:Mapframe: Difference between revisions
Appearance
Template>Uzume strict |
m 1 revision imported |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 92: | Line 92: | ||
dsep = ",", -- separator between inline and title (comma in the example above) | dsep = ",", -- separator between inline and title (comma in the example above) | ||
-- valid values for type | -- valid values for type parameter | ||
line = "line", -- geoline feature (e.g. a road) | line = "line", -- geoline feature (e.g. a road) | ||
shape = "shape", -- geoshape feature (e.g. a state or province) | shape = "shape", -- geoshape feature (e.g. a state or province) | ||
| Line 380: | Line 380: | ||
local lat_d = tonumber(parts[1]) | local lat_d = tonumber(parts[1]) | ||
assert(lat_d, "Unable to get latitude from input '"..coords.."'.") | |||
local lat_m = tonumber(parts[2]) -- nil if coords are in decimal format | local lat_m = tonumber(parts[2]) -- nil if coords are in decimal format | ||
local lat_s = lat_m and tonumber(parts[3]) -- nil if coords are either in decimal format or degrees and minutes only | local lat_s = lat_m and tonumber(parts[3]) -- nil if coords are either in decimal format or degrees and minutes only | ||
| Line 388: | Line 389: | ||
local long_d = tonumber(parts[1+#parts/2]) | local long_d = tonumber(parts[1+#parts/2]) | ||
assert(long_d, "Unable to get longitude from input '"..coords.."'.") | |||
local long_m = tonumber(parts[2+#parts/2]) -- nil if coords are in decimal format | local long_m = tonumber(parts[2+#parts/2]) -- nil if coords are in decimal format | ||
local long_s = long_m and tonumber(parts[3+#parts/2]) -- nil if coords are either in decimal format or degrees and minutes only | local long_s = long_m and tonumber(parts[3+#parts/2]) -- nil if coords are either in decimal format or degrees and minutes only | ||
| Line 798: | Line 800: | ||
local spanAttribs = { | local spanAttribs = { | ||
style = "font-size: small;", | style = "font-size: small;", | ||
id = "coordinates" | id = "mapframe-coordinates" | ||
} | } | ||
local indicatorContent = mw.text.tag('span', spanAttribs, titleTag) | |||
return mw.getCurrentFrame():extensionTag { | |||
name = "indicator", | |||
content = indicatorContent, | |||
args = { | |||
name = "zzz-mapframe" --zzz: show as last indicator | |||
} | |||
} | |||
end | end | ||