neveldo / jQuery-Mapael

jQuery plugin based on raphael.js that allows you to display dynamic vector maps
https://www.vincentbroute.fr/mapael/
MIT License
1.01k stars 195 forks source link

Styling plots text #312

Closed drexel75 closed 7 years ago

drexel75 commented 7 years ago

Hello, I cannot figure out how to add a border and background color to a text plot (i.e. cities names), this to make it more visible. Is this possible btw ? Thanks !

neveldo commented 7 years ago

Hello,

Unfortunately, SVG specification does not allows to set a background color nor a border to a text element , see https://stackoverflow.com/questions/15500894/background-color-of-text-in-svg .

A workaround should be to set an SVG under your texts with the wanted background color and border. See afterInit() doc & examples to see how to add custom shapes on the map : https://rawgit.com/neveldo/jQuery-Mapael/2.1.0/examples/advanced/afterInit_extend_raphael_paper.html

drexel75 commented 7 years ago

Thanks for your accurate reply and suggestion of workaround. This fully adresses my issue. ...And congratulations for Mapael, this is a real great achievement!

neveldo commented 7 years ago

I'm glad you appreciate Mapael and that it helped you ! Feel free to ask if you have more questions :)