Magnetic-field-compensation optical vector magnetometer