Optoelectronic measuring device having an electronic magnetic compass for determining an azimuthal orientation (a) of the measuring device and a compensation device associated with the magnetic compass for compensating device-fixed interference fields, wherein - the measuring device is designed to occupy at least two defined, repeatable operating states, wherein the measuring device has a different device-fixed interference field in each of the operating states, and - the compensation device has a computing unit and a memory, and a compensation functionality for carrying out an initial compensation of the electronic magnetic compass in a first and a second operating state of the measuring device characterized in that - the measuring device is designed to occupy at least two defined, repeatable application states, wherein in each of the application states the magnetic compass is exposed to a different external magnetic interference field, and - the compensation device is additionally designed to compensate for the external interference fields, wherein the compensation device is designed, in the context of the compensation functionality for carrying out the initial compensation, - by means of the magnetic compass: ▪ to measure a first magnetic field set in a first overall state of the measuring device, in which the measuring device occupies the first operating state and a first application state, ▪ to measure a second magnetic field set in a second overall state of the measuring device, in which the measuring device occupies the second operating state and the first application state, ▪ to measure a third magnetic field set in a third overall state of the measuring device, in which the measuring device occupies the first operating state and a second application state; and - by means of the processing unit: ▪ to determine, based on the first, second and third magnetic field set, a first, second and third parameter set (114, 124, 134) respectively, and ▪ to derive a fourth parameter set based on the first, second and third parameter set; and - to store the first, second, third and fourth parameter set in the memory of compensation device, wherein the derived fourth parameter set corresponds to a parameter set that can be determined based on a fourth magnetic field set, which is measurable in a fourth overall state of the measuring device, in which the measuring device occupies the second operating state and the second application state. - the measuring device is designed to occupy at least two defined, repeatable operating states, wherein the measuring device has a different device-fixed interference field in each of the operating states, and - the compensation device has a computing unit and a memory, and a compensation functionality for carrying out an initial compensation of the electronic magnetic compass in a first and a second operating state of the measuring device - the measuring device is designed to occupy at least two defined, repeatable application states, wherein in each of the application states the magnetic compass is exposed to a different external magnetic interference field, and - the compensation device is additionally designed to compensate for the external interference fields, - by means of the magnetic compass: ▪ to measure a first magnetic field set in a first overall state of the measuring device, in which the measuring device occupies the first operating state and a first application state, ▪ to measure a second magnetic field set in a second overall state of the measuring device, in which the measuring device occupies the second operating state and the first application state, ▪ to measure a third magnetic field set in a third overall state of the measuring device, in which the measuring device occupies the first operating state and a second application state; and ▪ to measure a first magnetic field set in a first overall state of the measuring device, in which the measuring device occupies the first operating state and a first application state, ▪ to measure a second magnetic field set in a second overall state of the measuring device, in which the measuring device occupies the second operating state and the first application state, ▪ to measure a third magnetic field set in a third overall state of the measuring device, in which the measuring device occupies the first operating state and a second application state; and - by means of the processing unit: ▪ to determine, based on the first, second and third magnetic field set, a first, second and third parameter set (114, 124, 134) respectively, and ▪ to derive a fourth parameter set based on the first, second and third parameter set; and ▪ to determine, based on the first, second and third magnetic field set, a first, second and third parameter set (114, 124, 134) respectively, and ▪ to derive a fourth parameter set based on the first, second and third parameter set; and - to store the first, second, third and fourth parameter set in the memory of compensation device,