We present a model calculation of transverse-momentum-dependent distributions (TMDs) of gluons in the nucleon. The model is based on the assumption that a nucleon can emit a gluon, and what remains after the emission is treated as a single spectator particle. This spectator particle is considered to be on-shell, but its mass is allowed to take a continuous range of values, described by a spectral function. The nucleon-gluon-spectator coupling is described by an effective vertex containing two form factors. We fix the model parameters to obtain the best agreement with collinear gluon distributions extracted from global fits. We study the tomography in momentum space of gluons inside nucleons for various combinations of their polarizations. These can be used to make predictions of observables relevant for gluon TMD studies at current and future collider facilities.