Anonymous user
Module:Coordinates: Difference between revisions
Jump to navigation
Jump to search
comments and formatting
No edit summary |
(comments and formatting) |
||
Line 1:
--[[
tmeplates. It provides several methods, including
local math_mod = require "Module:Math";▼
{{#Invoke:Coordinates | coord }}
Which provides the functionality to generate a coordinate link equivalent to
{{Coord}}
]]
globalFrame = nil
coordinates = {};
--
function displaytitle (s)
local l = "[[Geographic coordinate system|Coordinates]]: " .. s
Line 15 ⟶ 22:
end
--
function displayinline (s)
return s
end
--[[ Helper function, used in detecting DMS formatting ]]
local dmsTest = function(first, second)
local concatenated = first:upper() .. second:upper();
Line 31 ⟶ 38:
end
--[[
parseDec
Transforms decimal format latitude and longitude into the a
structure to used in displaying coordinates
]]
function parseDec( lat, long, format )
local coordinateSpec = {}
Line 59 ⟶ 69:
end
--[[ Helper function, handle optional args. ]]
function optionalArg(arg, suplement)
if arg ~= nil and arg ~= "" then
Line 64 ⟶ 75:
end
return ""
end
Line 97 ⟶ 101:
errors = validate( lat_d, lat_m, lat_s, long_d, long_m, long_s, 'parseDMS', true );
if
table.insert(errors, {"parseDMS", "Missing longitude" })
end
Line 345 ⟶ 349:
local precision = 0
if
precision = 5 + math.max( math_mod._precision(seconds_str), 0 );
elseif
precision = 3 + math.max( math_mod._precision(minutes_str), 0 );
else
|