Help:Main Page Map

The map used on the Main Page (see thumbnail to right) has expandable menus for different localities (North America, South America, Europe, Africa, Asia, & Australia/Oceana) and one for all the localities. This functionality is provided by the MediaWiki:MapMenu.js page, there have been other attempts at replacing this that still remain (i.e. Template:AllLocations, Template:NorthAmericanCountries, Template:IrelandStates, etc.) and probably can be removed/archived to avoid confusion.

MediaWiki:MapMenu.js
The MediaWiki:MapMenu.js provides all the functionality for the interactive map and is locked for so only site Admins can edit it (note, this is the general case for the MediaWiki: Namespace). The page starts with a variable (menus) that defines a JSON structure for the top level localities:
 * Africa = "africa_countries"
 * Asia = "asia_countries"
 * Europe = "europe_countries"
 * North America = "north_america_countries"
 * Australia/Oceana = "pacific_countries"
 * South America = "south_america_countries"

These top level localities have the class countrymenu that defines it as a top level and title (e.g. Africa, Asia, etc.) which controls the display text, then there is the list of countries that link to the correct genealogy page (i.e. ) where the first part is the wiki page name and the second part is the alternative text. When the country should have a subcategory (i.e. it's own expandable list), it will instead have the form  (i.e.  ) and there will be a statemenu (vs. countrymenu) class in alphabetical order below the top level localities. Note, the  is to make sure Google Translate works properly with a consistent id vs. diplayed text which previously broke the functionality.

For the statemenu class items (subcategories), it will have a name (i.e. "argentina_states" depending on the country name), class (i.e. statemenu), title (i.e. "Argentina Provinces" depending on the country this could be Provinces, States, Departments, etc.), and one additional field for parent (i.e. "south_america_countries" or the top level locality it falls under), then it will list the localities underneath similar to the top level localities.

Below the JSON structure for menus is the javascript code to create the lists of localities for each top level locality and combine them into the list of all localities.