Module:OrganizationsMap: Difference between revisions
No edit summary |
No edit summary |
||
Line 19: | Line 19: | ||
-- return string.gsub(ret, "^%s*(.-)%s*$", "%1") | -- return string.gsub(ret, "^%s*(.-)%s*$", "%1") | ||
return table.concat(ret, ' | return table.concat(ret, '\n' ) | ||
Revision as of 17:19, 5 December 2024
Documentation for this module may be created at Module:OrganizationsMap/doc
local p = {}
function p.main(frame)
-- local args = frame:getParent().args
local arr = mw.visualdata.query( 'Organization', '[[geolocation/latitude::+]]', {}, {} )
local ret = {}
for i,v in ipairs(arr) do
local v_ = v.data.geolocation.latitude .. ',' .. v.data.geolocation.longitude .. '~The city Ghent~Ghent is awesome~ ~ ~Ghent'
--table.insert(ret, string.gsub(v_, "^%s*(.-)%s*$", "%1"))
ret[#ret + 1] = string.gsub(v_, "^%s*(.-)%s*$", "%1")
end
-- return string.gsub(ret, "^%s*(.-)%s*$", "%1")
return table.concat(ret, '\n' )
-- Gent, Belgie~The city Ghent~Ghent is awesome~ ~ ~Ghent
-- Brussel~The city Brussel~The capital of Belgium~ ~ ~Brussels
-- Antwerp~The city Antwerp~ ~ ~ ~Antwerp
-- return mw.text.jsonEncode(ret)
end
return p