JQVMap area Click "Error"

I have a JQVMap setup as follows:

jQuery('#vmap').vectorMap({ map: 'usa_en', enableZoom: true, showTooltip: true, selectedRegion: 'MO', onRegionClick: function(element, code, region) { var message = 'You clicked "' + region + '" which has the code: ' + code.toUpperCase(); alert(message); }, }); 

When I click on any state, I get a status warning as above, but I also get a JS error in the console:

regionClickEvent not defined

This is the line if (!regionClickEvent.isDefaultPrevented()) { in the JQVMap file that is causing the error. How can I get the state pressed without throwing this error?

+6
jquery jqvmap
source share
1 answer

Found a solution, change line 466 in the jqvmap.js file to:

 regionClickEvent = $.Event('regionClick.jqvmap'); jQuery(params.container).trigger(regionClickEvent, [code, mapData.pathes[code].name]); 
+21
source share

All Articles