i found the plugin jVectorMap and i'm trying to mark the state that i selected with a diferente color
the same way that hover happens, but i what i want is, when clicked, the state keep "active" with some color.
the plugin have some actions like onRegionClick:
$('#map-teste').vectorMap({
map: 'br_en',
onRegionClick: function(event, code){
alert(code); // return the state
}
});
but i dont have any idea how to do this.
anyone achieve this ?
You can set the color for selected regions by adding regionStyle config parameters to the instantiation of your map. You would also want to set the regionSelectable to true:
$('#map-teste').vectorMap({
map: 'br_en',
onRegionClick: function(event, code){
alert(code); // return the state
},
regionsSelectable: true,
regionStyle: {
selected: {
fill: 'orange'
}
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With