Module:OrganizationsMap: Difference between revisions

From Wikiyouth
No edit summary
No edit summary
Line 10: Line 10:
   local ret = {}
   local ret = {}
   for i,v in ipairs(arr) do
   for i,v in ipairs(arr) do
     table.insert(ret, v.data.geolocation.latitude .. ',' .. v.data.geolocation.longitude .. '~abc')  
     table.insert(ret, v.data.geolocation.latitude .. ',' .. v.data.geolocation.longitude .. '~The city Ghent~Ghent is awesome~ ~ ~Ghent')  
    
    



Revision as of 15:54, 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', '[[name::+]]', {}, {} )



  local ret = {}
  for i,v in ipairs(arr) do
    table.insert(ret, v.data.geolocation.latitude .. ',' .. v.data.geolocation.longitude .. '~The city Ghent~Ghent is awesome~ ~ ~Ghent') 
   

  end

  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