Knowing where the device is currently located (which is pretty simple, at least on Android) and the relative positioning of the nearest (before implementation) GPS tracks (they must be loaded from somewhere explicitly).
The magnetometer should give you where you are on the device, which gives you a bearing (e.g. 180ΒΊ = south). This way you can calculate the cone of vision whose markers you want to show.
You just need to draw a camera image;)
source
share