Mahtab
Mahtab

Reputation: 21

jQVMap - Tooltips show hide option

I have a JQVMap that is showing Tooltips on each region, but in my map there are some region where i don't want to show tooltips - Please help. Thanks in advance

Upvotes: 2

Views: 2024

Answers (1)

Nafscript
Nafscript

Reputation: 5413

It`s described in jqvmap documentation:

Consider that fact that you can use standard features of jQuery events like event.preventDefault() or returning false from the callback to prevent default behavior of JQVMap (showing label or changing country color on hover). In the following example, when user moves mouse cursor over Canada label won't be shown and color of country won't be changed. At the same label for Russia will have custom text.

  jQuery('#vmap').vectorMap(
{
    onLabelShow: function(event, label, code)
    {
        if (code == 'ca')
        {
            event.preventDefault();
        }
        else if (code == 'ru')
        {
            label.text('Bears, vodka, balalaika');
        }
    },
    onRegionOver: function(event, code)
    {
        if (code == 'ca')
        {
            event.preventDefault();
        }
    },
});

Upvotes: 5

Related Questions