jquery - jVectorMap - How to reload/reset the map or just change the hover/active color states? -
i have page multiple maps on it, each map display different region data when clicked , have different region colors.
no i've accomplished this: can switch maps, load different data set, , change inactive region color, cant figure out how change hover color or active color.
right im changing inactive color with:
$.each(statemap.regioncodes, function(i, val) { fill[i] = newfillcolor; }); statemap.series.regions[0].setvalues(fill); but cant find way change color of selected/hovered regions.
if there isnt way on fly, can destroy , reset map using new colors?
use params object of map: mapobj.params.regionstyle.hover.fill = "red", mapobj.params.regionstyle.selected.fill = "blue".
you build custom myregionstyle settings object:
{ initial: { fill: 'white', "fill-opacity": 1, stroke: 'none', "stroke-width": 0, "stroke-opacity": 1 }, hover: { "fill-opacity": 0.8 }, selected: { fill: 'yellow' }, selectedhover: { } } and mapobj.regionstyle = myregionstyle
take @ documentation: http://jvectormap.com/documentation/javascript-api-v1/jvm-worldmap/
Comments
Post a Comment