Channel gain cartography relies on sensor measurements to construct maps providing the attenuation between arbitrary transmitter-receiver locations. A number of applications involving interference control, such as wireless network planning or cognitive radio, can benefit from channel gain maps. Existing approaches capitalize on tomographic models, where shadowing is the weighted integral of a spatial loss field (SLF) that depends on the propagation environment. Currently, the SLF is learned from sensor measurements whereas functions weighting the SLF are heuristically selected, but the effectiveness of the latter remains unclear. This paper leverages the framework of nonparametric regression in reproducing kernel Hilbert spaces to propose an algorithm that relies on the same sensor measurements as existing approaches to learn not only the SLF but also the associated weight function. Such an algorithm therefore constitutes a universal tool for channel gain cartography while revealing the nature of the propagation medium. An optimization method is proposed to minimize the pertinent criterion with closed-form updates. Simulation tests demonstrate the capabilities of the proposed algorithm.