fetch countries supported by YouTube and those supported by Twitter
compute union between these two sets of countries
when a marker is added for a certain country
display marker only if that country is part of the union
Twitter servlet to get supported countries
return set of country codes for countries supported by twitter
does not allow duplicates
API call will only be made once upon servlet instantiation
Problem
fetching the supported countries has to be a synchronous operation because the markers can only be added to the map once we know which countries we want to have markers for
therefore, we have to wait for the supported countries to be fetched which produces a very short delay when the page is loaded
In script.js
Twitter servlet to get supported countries
Problem