A drastic transition from fast-forming, 2D, ramified and bright deposits to slow-forming, 3D, compact and dark ones is observed during the electrodeposition of silver at the air-water interface, using a silver cathode and a nickel anode. This topological Hecker transition is shown to be caused by ions that dissolve from the anode, migrate through the liquid, and poison the growing deposit towards further reaction. For iron and silver anodes no dimensional transition is observed, only a morphological one, leaving the growth two-dimensional The spatial position of the Hecker transition in the deposition cell in our geometry is shown to be determined by the ionic concentrations and not only by the mobilities, as is the case in the thin-cell geometry. The transitions are related to the electrochemical properties of the ions and are interpreted in terms of a dimensionless characteristic parameter, the Wagner number. By introducing a variety of ions directly into the solution, we developed a scale for the relative strength of the effect for the ionic species studied.