How to Make Compass Point to 258.5 degree?

JassimRahmaJassimRahma USMember ✭✭✭✭

Hi,

How can I make the Xamarin Essentials Compass to always point at 258.5 degree?

Thanks,
Jassim

Answers

  • ColeXColeX Member, Xamarin Team Xamurai

    Compass class is used to monitor the device's magnetic north heading , the degree value is determine by device direction , ,what's the scenario do you want to control the degree ?

  • JassimRahmaJassimRahma USMember ✭✭✭✭

    Yes, I want to point the compass to a specific degree

    I am getting the degree through a formula, let's say result is 280.5 so I want the compass to always point o 280.5 as an example

  • suraj007suraj007 Member ✭✭✭

    void Compass_ReadingChanged(object sender, CompassChangedEventArgs e)
    {
    Heading = 280.5;
    HeadingDisplay = $"Heading: {Heading.ToString()}";
    }

  • suraj007suraj007 Member ✭✭✭

    https://github.com/jamesmontemagno/app-compass
    ///replace code in MyCompassViewModel
    void Compass_ReadingChanged(object sender, CompassChangedEventArgs e)
    {
    Heading = 280.5;
    HeadingDisplay = $"Heading: {Heading.ToString()}";
    }

Sign In or Register to comment.