Module:Coordinates: Difference between revisions

Jump to navigation Jump to search
per edit request on talk page
(remerge changes, but without changes to displaytitle)
(per edit request on talk page)
Line 24:
 
--[[ 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>';
Line 36:
 
--[[ Helper function, used in detecting DMS formatting ]]
local function dmsTest (first, second)
if type(first) ~= 'string' or type(second) ~= 'string' then
return nil
Line 617:
and entity.claims.P625[1].mainsnak.snaktype == 'value'
then
args[1]local precision = entity.claims.P625[1].mainsnak.datavalue.value.latitudeprecision
args[21] = entity.claims.P625[1].mainsnak.datavalue.value.longitudelatitude
args[2]=entity.claims.P625[1].mainsnak.datavalue.value.longitude
if precision then
precision=-math_mod._round(math.log(precision)/math.log(10),0)
args[1]=math_mod._round(args[1],precision)
args[2]=math_mod._round(args[2],precision)
end
end
end
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu