Respect visibility of layer when updating features

When new features are created we need to set the visibility based
on the layer.
Respect layer visibility when update legend

Legend feature need to be set to the visibility of the layer it
belongs to.
Merge remote-tracking branch 'origin/200-fix-toggle-visibility'