adding showLegend option for layers