Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


OnRegionClick and event.preventDefault #99

LorenDorez opened this Issue · 2 comments

3 participants

LorenDorez sebastian herrera Darren Felton

Ho I am trying to prevent the clicking of certain states but it isnt working.

After further debugging this code always returns false


If i check this its true..

sebastian herrera

you have to define those state codes like this:

onRegionClick: function (element,code,region,event)
if (code == "tx" ||
code == "fl")

Darren Felton

@sebastianherrera Good day to you. I'm having trouble implementing this for jqvmap's world map. The exact same logic works fine on my USA and Canada map, however for some reason the World map, event is undefined? Any ideas what's going on

For example:

onRegionClick: function(element,code,region,event)
alert(event); // Alerts "undefined", tells me it wasn't passed to the function
event.preventDefault(); // Throws error "Cannot read property 'preventDefault' of undefined.

Strangely enough, it does work for onRegionOver of the same map.

onRegionOver: function(event, code, region) {

Roman Sukochev Leolik referenced this issue from a commit in Leolik/jqvmap
Leolik #99 3beca2f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.