javascript - javectorMap:Select one region only -
i using jvectormap http://jvectormap.com/ in project. code follow
<div id="world-map" style="width:750px;height:380px;float: left;" ></div> $('#world-map').vectormap({ backgroundcolor: '#0099ff', hovercolor: '#fcef06', hover: { stroke: 'black', "stroke-width": 2, fill:'#fcef06' }, /* hover color each state */ onregionclick: function(event, code) { alert(code); }, regionsselectable: true, regionstyle: { fill:'black', selected: { fill: 'red' } }, });
now can select multiple countries/regions in map.my requirement select 1 country/region @ time. how can it??
along regionsselectable
property, there regionsselectableone
property go it.
setting regionsselectable
true lets select regions , setting regionsselectableone
true allows 1 selected @ time.
jvectormap documentation
$('#world-map').vectormap({ backgroundcolor: '#0099ff', hovercolor: '#fcef06', hover: { stroke: 'black', "stroke-width": 2, fill:'#fcef06' }, /* hover color each state */ onregionclick: function(event, code) { alert(code); }, regionsselectable: true, regionsselectableone: true, //add line here regionstyle: { fill:'black', selected: { fill: 'red' } } });
javascript jvectormap
No comments:
Post a Comment