How does an electric compass work?

I came across a small pocket digital readout compass the other day. It appeared to be completely electronic, with no moving parts.

How is this thing measuring the magnetic field, and determining its polarity?

The subject you want to look up is “Hall Effect”:

http://www.britannica.com/bcom/eb/article/3/0,5716,39723+1,00.html

Now, what I want to know is why the little handheld hiker’s gps unit I have can’t incorporate a digital compass as well.

vb’s parser thinks the commas are terminators:

try this