Modul:Wikidata/Formatters/globecoordinate: Porovnání verzí
< Modul:Wikidata | Formatters
Smazaný obsah Přidaný obsah
m argumenty |
m potlačení Modul:GlobeCoordinate, dokud se nevyřeší problém |
||
Řádek 15: | Řádek 15: | ||
function p.formatValue(value, options) |
function p.formatValue(value, options) |
||
local GlobeCoordinate = require 'Modul:GlobeCoordinate' |
--local GlobeCoordinate = require 'Modul:GlobeCoordinate' |
||
local _value = GlobeCoordinate.newFromWikidataValue(value) |
--local _value = GlobeCoordinate.newFromWikidataValue(value) |
||
local Coord = require 'Modul:Souřadnice' |
local Coord = require 'Modul:Souřadnice' |
||
local args = { |
local args = { |
||
value.latitude, |
|||
value.longitude, |
|||
} |
} |
||
setmetatable(args, { __index = options }) |
setmetatable(args, { __index = options }) |
Verze z 9. 11. 2017, 19:44
require 'Modul:No globals'
local p = {}
function p.getRawValue(value, options)
local lib = require 'Modul:Wikidata/lib'
if not options.field then
return error(lib.formatError('param-not-provided', 'field'))
elseif options.field == 'latitude' or options.field == 'longitude' or options.field == 'precision' or options.field == 'globe' then
return value[options.field]
else
return error(lib.formatError('invalid-field', options.field))
end
end
function p.formatValue(value, options)
--local GlobeCoordinate = require 'Modul:GlobeCoordinate'
--local _value = GlobeCoordinate.newFromWikidataValue(value)
local Coord = require 'Modul:Souřadnice'
local args = {
value.latitude,
value.longitude,
}
setmetatable(args, { __index = options })
return Coord._renderCoordinates(args, mw.getCurrentFrame())
end
return p