High Accuracy Magnetometer?

I am looking for a high accuracy magnetometer to measure the altitude and azimuth of my telescope

I don't even have a vision of how a magnetometer could be used to measure the position of a telescope mount through it's alt and azi travel limits. I've only seen high resolution quadrature encoders used for such applications. Tell me how your sensor choice and setup would work assuming you could find the resolution needed.

Lefty