We present an all-optical method to measure and compensate for residual
magnetic fields present in a cloud of ultracold atoms trapped in an optical
dipole trap. Our approach leverages the increased loss from the trapped atomic
sample through electromagnetically induced absorption. Modulating the
excitation laser provides coherent sidebands, resulting in {\Lambda}-type
pump-probe scheme. Scanning an additional magnetic offset field leads to pairs
of sub-natural linewidth resonances, whose positions encode the magnetic field
in all three spatial directions. Our measurement scheme is readily implemented
in a typical quantum gas experiments and has no particular hardware
requirements