a function to compare layers, to be called from layerViewerGui.updateAllLayers