vmap:如何仅为所选国家/地区着色

时间:2014-01-05 14:44:25

标签: jquery jqvmap

我正在使用jQuery VMap,它可以正常使用此代码

    jQuery('#vmap2').vectorMap({
        map: 'world_en',
        backgroundColor: '#fff',
        color: '#9e2842',
        hoverOpacity: 0.6,
        selectedColor: '#8B0000',
        enableZoom: true,
        showTooltip: true,
        values: sample_data,
        scaleColors: ['#D35471', '#691B2D'],
            selectedRegion: null,
        normalizeFunction: 'polynomial',
        onRegionClick: function(element, code, region)
        {

            if (region == "Singapore") {
               document.getElementById('mailblock').innerHTML = 'Contact Information for Singapore :';
            }
            if (region == "HongKong") {
               document.getElementById('mailblock').innerHTML = 'Contact Information    for HongKong :';
            }
        }
    });

现在我想改变所选国家的颜色,只说悬停的5-6个国家。

1 个答案:

答案 0 :(得分:4)

得到了答案

jQuery('#vmap2').vectorMap('set', 'colors', { au: '#9e2842'});

它有效