jsvectormap
jsvectormap copied to clipboard
Marker label color
Hello,
I'm trying to change the marker label text color with
markers: [
{
name: "Paris",
coords: [48.8566, 2.3522],
style: { fill: 'orange' , color:'white'} // Add style for this particular marker
}
],
Tried also text:'white' with no result either...
Wondering if it's possible ? Thanks ! Denis
Hello @dgillier
Changing a particular marker's label style is not possible currently.
But you can change all markers labels style with:
const map = new jsVectorMap({
markerLabelStyle: {
initial: {
fill: '#35373e',
},
// You can control the hover and selected state for labels as well.
hover: {
fill: 'red'
},
selected: {
fill: 'blue'
}
},
})
However, if you need to change a particular marker's label, you can use CSS as a workaround.
#jvm-markers-labels-group .jvm-element[data-index="2"] {
fill: red;
}