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.
LeafletJS reference mentions a
classNameoption for several classes, such asPath(https://leafletjs.com/reference.html#path). The option is used to give elements custom CSS classes. It is implemented in Folium as theclass_namekeyword argument, but it is currently only available forDivIconandGeoJsonPopup.I would like to be able to give custom classes to
PolyLineelements (and otherBaseMultiLocationelements) via theclass_namekeyword argument.Currently, I'm abusing the
fill_colorargument (and settingfill_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.