The library doesn't provide an automatic way of highlighting regions based on markers but you can use the series
option to change behavior of regions / markers.
If you want to highlight regions on map initialization, you need to pass a list of objects with the code of your regions and a key color value.
Imagine you want to highlight following regions: BE, NL, DE
. You need to pass this to the series values:
{ 'BE': '1', 'NL': '1', 'DE': '1' }
And the sample code where the value 1
is attributed to the color #4169E1
(as an example)
new jvm.WorldMap({
map: '',
container: $(''),
series: {
regions: [{
scale: {
'1': '#4169E1'
},
attribute: 'fill',
values: { 'BE': '1', 'NL': '1', 'DE': '1' }
}]
}
});
Because you already have the list of markers, you can easily build this highlight region list
.