Yes, but on each connected subset of the domain, the map will need to be constant; this follows from the maximum modulus principle.