Coupling of deformation and electronic properties in two-dimensional materials