Fix a bug with the legend chooser when the layer contains only geometries

Remove unused code and fix the legend chooser when a layer contains only one or more geometry columns.