You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add class_name argument to more map elements #2055
LeafletJS reference mentions a className option for several classes, such as Path (https://leafletjs.com/reference.html#path). The option is used to give elements custom CSS classes. It is implemented in Folium as the class_name keyword argument, but it is currently only available for DivIcon and GeoJsonPopup.
I would like to be able to give custom classes to PolyLine elements (and other BaseMultiLocation elements) via the class_name keyword argument.
Currently, I'm abusing the fill_color argument (and setting fill_opacity=0) as a place to store the classes to be later accessed and properly added by a JS script, but this solution is far from perfect, to put it mildly.
Activity
Conengmo commentedon Dec 17, 2024
This is a good point. Classes like
PolyLineaccept**kwargs, but then this gets stripped in thepath_optionsfunction.I don't think we should add
class_nameas explicit keyword arguments, but we should allow users to pass it through**kwargs.We should add
classNameas a valid option in the**kwargsofpath_options. Should be easy to add and test for. PR's are welcome!Add className option (#2074)