[GIS] How to specify (cross-browser) mouse pointer sets on leaflet control

cssleafletstyle

Leaflet custom controls might be interactive, when the user can use the mouse on them to perform an action, or non-interactive, when they are used only to show information. This should affect the mouse pointer used for elements of the control (and possibly sub-elements of it for partly interactive controls).

What is the correct way to set those pointers for the control container and its sub-elements, if any (e.g. well defined css classes or else)?

Best Answer

Building on the answer by IvanSanchez, you can add a class to a layer:

var layer = L.featureGroup([]);
layer.style({'className': 'mask'})

then in CSS

path.leaflet-interactive.mask {cursor: crosshair}