Efficient near-field analysis of the electromagnetic scattering based on the dirichlet-to-neumann map