0

Good day all. I'm using JQVmap, I'm trying to show a tooltip while mouseovering some elements that are not in the svg map.

This comes to solve the issue that some of the countries are really small, so I'd like to provide the user some buttons on the map to show te tooltips of Greece, and Singapore (for example).

Actually I try to trigger the same event that is triggered in the jquery.vmap.js:

jQuery(params.container).trigger(labelShowEvent, [map.label, code]);

I've done this:

$('#vmap').trigger(labelShowEvent, [tooltipMaker("gr"), "gr"]);

and this:

$('#vmap').trigger(jQuery.Event('labelShow.jqvmap'), [tooltipMaker("gr"), "gr"]);

ofcourse without any luck.

the second attempt I recieved this error:

Uncaught TypeError: label.html is not a function

so I try to solve it by assign a function to that parameter:

label.html(tooltipMaker(code));

and defined a function like:

function tooltipMaker(code){
    return '<div class="map-tooltip"><h3 class="header">Country: '+code+' </h3><p class="description">'+code+'</p></div>';
    }

but it does not solve anything. Is there anyone that has the same problem and solve it somehow?

in the end I could also build a tooltip similar to the one used in the map, but I'd like to use the map logic (without doing a new map with the buttons as "real" fake regions, which it would be very difficult and long).

Matteo Bononi 'peorthyr'
  • 2,170
  • 8
  • 46
  • 95

0 Answers0