JQVMAP country coloring

I am using JQVMAP in here . When I have a country in which there are members, I want to change this color of the country without keeping it silent when the map is displayed.

I use the following sql to get countries and the number of their members. My question is: what should I do if I have a country to change the color of the map of countries? All countries will have the same color.

$result=mysql_query("SELECT COUNT(profile3.organizations) total_org, LEFT(countryCODEconversions.Code, 2) FROM profile3, countryCODEconversions WHERE TRIM(MID(countryCODEconversions.Code, 4, 147)) = profile3.country GROUP by profile3.country"); //if(mysql_num_rows($result)>0){ $counter = ""; while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { foreach ($line as $value) { $counter += 1; $value = stripslashes($value); if ($counter == 1){$total = nl2br($value);} if ($counter == 2){ $counter = 0; $countryCode = strtolower($value); ?> gdpOrgData['<?=$countryCode?>']=("<?=$total?>"); <?

+4
source share
1 answer

Normal, after loading the map, you can set the color of countries that need a different color, for example:

jQuery(document).ready(function() {
       jQuery('#vmap').vectorMap('set', 'colors', {lt: '#8c9622', 
                                                    sv: '#8c9622', 
                                                    yr: '#8c9622'});
});

You can use PHP to create a list in this script. Just load it after loading the map. Hope this points you in the right direction.

+2
source

All Articles