bjornd / jvectormap

jvectormap.com
GNU Affero General Public License v3.0
1.38k stars 430 forks source link

Extended label config to support styles by key #409

Open miekademarco opened 7 years ago

miekademarco commented 7 years ago

the changes will allow you to customise the style of labels for every item.

eg:

 labels: {
    markers: {
        render: function (index) {
            return markers[index].labelText;
        },
        offsets: function (index) {
            return markers[index].offset;
        },
        styles: function (index) {
            return { fill: markers[index].labelFill };
        }
    }
}
vrdriver commented 5 years ago

Wow! This just saved me at the end of hours of 'figuring out'. Thanks so much! This should definitely committed to the main branch.