Sets the visibility of a specific legend item and updates the class filter.
The map identifier.
The layer path containing the item.
The legend item to update (mutated in place).
The new visibility state.
Optional class filter string to apply.
Sets the visibility of a specific legend item and updates the class filter.