Deprecated: Use of MediaWiki\Skin\Skin::appendSpecialPagesLinkIfAbsent was deprecated in MediaWiki 1.44. [Called from MediaWiki\Skin\Skin::buildSidebar in /var/www/wikisphere.org/mediawiki-1.44.0/includes/skins/Skin.php at line 1639] in /var/www/wikisphere.org/mediawiki-1.44.0/includes/debug/MWDebug.php on line 386
Jump to content

Module:OrganizationsMap: Difference between revisions

From Wikiyouth
No edit summary
No edit summary
Line 17: Line 17:
  ret = table.concat(ret, '\n' )
  ret = table.concat(ret, '\n' )


ret = ret:match("^%s*(.-)%s*$")
return string.gsub(ret, "^%s*(.-)%s*$", "%1")


return ret




Line 27: Line 26:


--  return mw.text.jsonEncode(ret)
--  return mw.text.jsonEncode(ret)
end
end


return p
return p

Revision as of 16:06, 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

 ret = table.concat(ret, '\n' )

return string.gsub(ret, "^%s*(.-)%s*$", "%1")



--   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