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

Various internal improvements #344

Closed Indigo744 closed 7 years ago

Indigo744 commented 7 years ago

This PR implements some various internal improvements.

The main enhancement concerns the option: each element option is stored in the element object, alongside mapElem and textElem. This allows to simplify quite a bit of various other stuff related to the options, like HTML links options, tooltip options, event handlers...

Also, the getBBoxCenter is removed (fix #340).

neveldo commented 7 years ago

Storing the area / plot options within the objects next to mapElem and textElem is a great idea that allowed you to introduce a lot of simplifications , the elements configuration parts are a lot more clear now. I'm also glad to see the code factorization within the two new functions that you have introduced (setPlotAttributes and setPlotCoords).