I am working with a pretty cool interactive us map using jquert from newsignature (http://newsignature.github.com/us-map/). I am having trouble figuring out how I can enter unique information for each state when clicked on. In other words, when a user would click on Washington they would get certain information vs. when the click on Arkansas. Perhaps even the ability to have the content styled.
The current code I am using is:
$(document).ready(function() {
$('#map').usmap({
'stateSpecificStyles': {
'AK' : {fill: '#0F253F'}
},
'stateSpecificHoverStyles': {
'HI' : {fill: '#0F253F'}
},
'mouseoverState': {
'HI' : function(event, data) {
//return false;
}
},
'click' : function(event, data) {
$('#alert')
.text('Click '+data.name+' copy ')
.stop()
.css('backgroundColor', '#ff0')
.animate({backgroundColor: '#ddd'}, 1000);
}
});
});
What I would like to see happen is when you click on a specific state it displays information regarding that state vs. the same info for each state.
Well, the state that they clicked on is in the
data.nameproperty. There are many ways to go about this. What have you tried?Actually, now that I look more at the documentation, you could also make state-specific methods like this: