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

Content deleted Content added
mNo edit summary
Reverted to revision 3984733 by Ninjastrikers (talk). (TW)
ထႅဝ် 27:
--[[ Helper function, replacement for {{coord/display/title}} ]]
local function displaytitle(s, notes)
local l = "[[Geographic coordinate system|ၵူဝ်ႇဢေႃးတိၼဵတ်ႉCoordinates]]: " .. 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 70 ⟶ 68:
local result = ""
for i,v in ipairs(errors) do
local errorHTML = '<strong class="error">ၵူဝ်ႇဢေႃးတိၼဵတ်ႉCoordinates: ' .. v[2] .. '</strong>'
result = result .. errorHTML .. "<br />"
end
Line 77 ⟶ 75:
 
--[[
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 102 ⟶ 94:
 
--[[
specPrinter
 
Output formatter. Takes the structure generated by either parseDec
or parseDMS and formats it for inclusion on Wikipedia.
|
specPrinter
 
Line 173 ⟶ 160:
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 179 ⟶ 166:
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 189 ⟶ 176:
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 202 ⟶ 189:
 
--[[
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 228 ⟶ 212:
 
--[[
Convert DMS format into a N or E decimal coordinate
|
Convert DMS format into a N or E decimal coordinate
]]
Line 255 ⟶ 237:
end
 
--[[
Checks input values to for out of range errors.
|
Checks input values to for out of range errors.
]]
Line 329 ⟶ 309:
 
--[[
parseDec
 
Transforms decimal format latitude and longitude into the
structure to be used in displaying coordinates
|
parseDec
 
Line 367 ⟶ 342:
 
--[[
parseDMS
 
Transforms degrees, minutes, seconds format latitude and longitude
into the a structure to be used in displaying coordinates
|
parseDMS
 
Line 423 ⟶ 393:
 
--[[
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 508 ⟶ 475:
 
--[[
Generate Wikidata tracking categories.
|
Generate Wikidata tracking categories.
]]
Line 576 ⟶ 541:
 
--[[
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"