Display compass - ArcGIS Runtime SDK - Xamarin.Forms

581 views Asked by At

I am using the 1st release of the ArcGIS Runtime SDK for .Net - Xamarin.Forms (nuget package here).

One of the requirements is to display a compass that indicates the north. I haven't found any build-in feature for the moment. Is someone can point me out how to implement this functionality ?

1

There are 1 answers

0
Thomas On BEST ANSWER

So after few research, I've implemented a custom solution:

  • Find a compass icon that can rotate (see this article to add image resource to Xamarin.Form)

  • Add the image on top of the map:

    <Image x:Name="NorthArrow" />
    
  • Rotate the image when the view point changed:

    MapView.ViewpointChanged += (sender, args) =>
    {
        NorthArrow.Rotation = -MapView.MapRotation;
    };
    

Complete solution here.