မေႃႇၵျူး:Coordinates: လွင်ႈပႅၵ်ႇပိူင်ႈ ၼႂ်းၵႄႈ လွင်ႈၶူၼ်ႉၶႆႈ

Content deleted Content added
mNo edit summary
mNo edit summary
ထႅဝ် 27:
--[[ Helper function, replacement for {{coord/display/title}} ]]
local function displaytitle(s, notes)
local l = "[[|Geographic coordinate system|ၵူဝ်ႇဢေႃးတိၼဵတ်ႉ]]: " .. s
local co = '<span id="coordinates">' .. l .. notes .. '</span>';
return '<span style="font-size: small;">' .. co .. '</span>';
ထႅဝ် 37:
end
 
--[[ Helper function, used in detecting DMS formatting | Helper function, used in detecting DMS formatting ]]
local function dmsTest(first, second)
if type(first) ~= 'string' or type(second) ~= 'string' then
ထႅဝ် 57:
end
 
--[[ Helper function, handle optional args. | Helper function, handle optional args. ]]
local function optionalArg(arg, supplement)
return arg and arg .. supplement or ''
ထႅဝ် 63:
 
--[[
Formats any error messages generated for display
|
Formats any error messages generated for display
]]
Line 75 ⟶ 77:
 
--[[
Determine the required CSS class to display coordinates
 
Usually geo-nondefault is hidden by CSS, unless a user has overridden this for himself
default is the mode as specificied by the user when calling the {{coord}} template
mode is the display mode (dec or dms) that we will need to determine the css class for
|
Determine the required CSS class to display coordinates
 
Line 94 ⟶ 102:
 
--[[
specPrinter
 
Output formatter. Takes the structure generated by either parseDec
or parseDMS and formats it for inclusion on Wikipedia.
|
specPrinter
 
Line 160 ⟶ 173:
end
 
--[[ Helper function, convert decimal to degrees | Helper function, convert decimal to degrees ]]
local function convert_dec2dms_d(coordinate)
local d = math_mod._round( coordinate, 0 ) .. "°"
Line 166 ⟶ 179:
end
 
--[[ Helper function, convert decimal to degrees and minutes | Helper function, convert decimal to degrees and minutes ]]
local function convert_dec2dms_dm(coordinate)
coordinate = math_mod._round( coordinate * 60, 0 );
Line 176 ⟶ 189:
end
 
--[[ Helper function, convert decimal to degrees, minutes, and seconds | Helper function, convert decimal to degrees, minutes, and seconds ]]
local function convert_dec2dms_dms(coordinate)
coordinate = math_mod._round( coordinate * 60 * 60, 0 );
Line 189 ⟶ 202:
 
--[[
Helper function, convert decimal latitude or longitude to
degrees, minutes, and seconds format based on the specified precision.
|
Helper function, convert decimal latitude or longitude to
degrees, minutes, and seconds format based on the specified precision.
Line 212 ⟶ 228:
 
--[[
Convert DMS format into a N or E decimal coordinate
|
Convert DMS format into a N or E decimal coordinate
]]
Line 238 ⟶ 256:
 
--[[
Checks input values to for out of range errors.
|
Checks input values to for out of range errors.
]]
Line 309 ⟶ 329:
 
--[[
parseDec
 
Transforms decimal format latitude and longitude into the
structure to be used in displaying coordinates
|
parseDec
 
Line 342 ⟶ 367:
 
--[[
parseDMS
 
Transforms degrees, minutes, seconds format latitude and longitude
into the a structure to be used in displaying coordinates
|
parseDMS
 
Line 393 ⟶ 423:
 
--[[
Check the input arguments for coord to determine the kind of data being provided
and then make the necessary processing.
|
Check the input arguments for coord to determine the kind of data being provided
and then make the necessary processing.
Line 475 ⟶ 508:
 
--[[
Generate Wikidata tracking categories.
|
Generate Wikidata tracking categories.
]]
Line 541 ⟶ 576:
 
--[[
Helper function to determine whether to use D, DM, or DMS
format depending on the precision of the decimal input.
|
Helper function to determine whether to use D, DM, or DMS
format depending on the precision of the decimal input.
ဢဝ်ၶိုၼ်းမႃးတီႈ "https://shn.wikipedia.org/wiki/မေႃႇၵျူး:Coordinates"