added option for grouping layers according to legendinterface