Scalar electrodynamics can be used to investigate the formation of cosmic strings in the early universe. We present the results of lattice Monte Carlo simulations of an effective three-dimensional U(1)+Higgs theory that describes the equilibrium properties of finite-temperature scalar electrodynamics near the transition. A gauge-invariant criterion for the existence of a vortex is used in measuring the properties of the vortex network in the equilibrium state both in the Coulomb and in the Higgs phase of the system. The naive definition of the vortex density becomes meaningless in the continuum limit and special care is needed in extracting physical quantities. Numerical evidence for a physical discontinuity in the vortex density is given.