By including the recently introduced thermal shear term of the spin polarization vector at local equilibrium we determine longitudinal polarization of Λ hyperons emitted from a hot and rotating hadronic medium using the thermal model with single freeze-out. In our analysis we consider top RHIC energy and use the model parameters which were determined in the previous analyses of particle spectra and elliptic flow. We confirm that unlike the previous calculations done by using only the thermal vorticity, the thermal shear term alone leads to the correct sign of the quadrupole structure of the longitudinal component of the polarization three vector as measured in experiments. However, we find almost complete cancellation between thermal and shear vorticity terms, which leads to the disagreement with the data. To clarify the role played by velocity and temperature gradient terms, we present a systematic analysis of different contributions to the longitudinal polarization.