I read that the astronauts who used Lunar rovers used heading indicators, which typically use compasses, for direction. How, on the Moon, did their equipment tell the direction of travel, presuming a compass made for earth would not work on the Moon?
The Lunar Roving Vehicle did have a (form of) compass. It was gyroscopic rather than magnetic, thus it needed calibration when first powered up using the sun angle as a reference. It's in the upper left of the console here:
According to Wikipedia:
Navigation was based on continuously recording direction and distance through use of a directional gyro and odometer and feeding this data to a computer that would keep track of the overall direction and distance back to the LM. There was also a Sun-shadow device that could give a manual heading based on the direction of the Sun, using the fact that the Sun moved very slowly in the sky.
I presume the "bearing" display in the middle of the compass is the direction to travel back to the LM. Sun-shadow navigation was helped by the fact that the sun was low in the East during all the lunar EVAs.
The rovers used a gyroscope-based navigation system.
The Lunar Roving Vehicle (LRV) navigation system consists of a directional gyro, a set of incremental odometers, and a hybrid analog-digital signal processor plus appropriate controls and readouts.
Info from Lunar Roving Vehicle Navigation System Performance Review, (NASA Tech Note D-7469)