【问题标题】:vmap: how to color selected countries onlyvmap:如何只为选定的国家着色
【发布时间】:2014-01-06 11:21:40
【问题描述】:

我正在使用 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 个国家/地区。

【问题讨论】:

    标签: jquery jqvmap


    【解决方案1】:

    得到答案

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

    有效

    【讨论】:

    • 您可能希望将其设置为解决方案,以便其他人可以立即看到这是答案。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-25
    • 2013-12-30
    • 2015-01-27
    • 2012-01-18
    • 2013-09-30
    相关资源
    最近更新 更多