People living in coastal areas of New Zealand closest to a huge earthquake that struck offshore early on Friday were temporarily ordered to evacuate due to fears of a tsunami.