Customize the appearance of the states by default or on hover. Override individual state settings to create heat maps and other features.
stateStyles style object
The default styles for the state shapes.
$('#map').usmap({
stateStyles: {fill: 'blue'}
});
stateHoverStyles style object
The default hover styles for the state shapes.
$('#map').usmap({
stateHoverStyles: {fill: 'red'}
});
stateHoverAnimation milliseconds
The time in milliseconds for the animation between styles when hovering over a state shape.
$('#map').usmap({stateHoverAnimation: 300});
stateSpecificStyles {<state>: <style object>}
An object to override the default styles for individual states.
The object keys are the state abbrivation with the value being the style object.
$('#map').usmap({
stateSpecificStyles: {
'MD': {fill: 'yellow'},
'VA': {fill: 'teal'}
}
});
stateSpecificHoverStyles {<state>: <style object>}
An object to override the default hover styles for individual states.
The object keys are the state abbrivation with the value being the style object.
$('#map').usmap({
stateSpecificHoverStyles: {
'MD': {fill: 'purple'},
'VA': {fill: 'orange'}
}
});
showLabels boolean
Turn on or off the display of the labels.
$('#map').usmap({showLabels: true});
labelWidth pixels
The width of the labels.
labelHeight pixels
The height of the labels.
labelGap pixels
The distance between labels.
labelRadius pixels
The radius of the rounded corners of the labels.
labelBackingStyles style object
The default styles for the label shapes.
labelBackingHoverStyles style object
The default hover styles for the label shapes.
stateSpecificLabelBackingStyles
An object to override the default styles for individual label.
The object keys are the state abbreviation with the value being the style object.
stateSpecificLabelBackingHoverStyles
An object to override the default hover styles for an individual label.
The object keys are the state abbreviation with the value being the style object.
labelTextStyles
The styling for the label text.
stateSpecificLabelTextStyles
An object to override the default styles for an individual label text.
The object keys are the state abbreviation with the value being the style object.
stateSpecificLabelTextHoverStyles
An object to override the default hover styles for an individual label text.
The object keys are the state abbreviation with the value being the style object.