1

How to Get the mouse position, in "onRegionOver:function(event,code,region)" in jqvmap???

The event object in the function, doesn't have the properties from mouse position. I need show a div, with extra country information, when the mouse overs the region.

thank you very much!

1 Answers1

2

First of all I am not sure if this is a right approach or not. If you open the jquery.vmap.js plugin file, check out this code:

if (e.type == 'mouseover') {
    jQuery(params.container).trigger(regionMouseOverEvent, [code, mapData.pathes[code].name]);

Change the code of the following line to:

jQuery(params.container).trigger(regionMouseOverEvent, [e, code, mapData.pathes[code].name]);

This event e is passed as a parameter to the function in the plugin. And in your call back function add one more parameter

onRegionOver:function(event,e,code,region){
    alert(e.pageX,"_",e.pageY);
}

This worked for me...Hope this Helps for you

Gerstmann
  • 5,368
  • 6
  • 37
  • 57