Topological solitary waves with arbitrary charge and the electromagnetic field