Formation of polysaccharide gel layers in the presence of Ca2+ and K+ ions: measurements and mechanisms.