An earthquake that struck off the coast of California on Thursday sparked tsunami warnings for the coasts in California and Oregon.