Well the title says it all but here is some code so you see what i mean.
function eachFeature(feature, layer) {
layer.on({
mouseover: highlightFeature,
mouseout: resetHighlight,
});
}
geojson = L.geoJson(geojson_raw, { style: style, onEachFeature: eachFeature });
geojson.addTo(map);
geojson_raw
is the geojson object which is held in a javascript variable.
style
is just the function that returns an object with some style attributes.
highlightFeature
/ resetHighlight
are functions to change these styles according to mousein/out events.
So this code works and I already know how to change styles by reacting on user events. But how can I set an actual css-classname on the paths that are created from my geojson data? Later in my code I would like to select paths by a specific classname.