Search code examples
mapsmaui

In .net Maui using Maui.Controls.Maps How Do I Change The Map Orientation


I am able to create a test project to display a map at a specified location on the UI. What I would like to do is to be able to spin the map by a specified number of degrees (0 - 360). Basically, I would like to link the map to the compass so that the top of the map on the screen points to the way the device (phone) is pointing. Many thank for any help.

I have search extensively but cant find a way to do this. It seemed the location course property would help but I don't quite understand what this property represents. Setting a value to course does not seem to do anything.


Solution

  • The only way I was able to be able to rotate the map is to use Google Map using the Onion.Maui.GoogleMaps NuGet Package rather than Microsoft.Maui.Controls.Maps NuGet Package, which seems to have limited functionality. I am able to use the CameraUpdateFactory.NewCameraPosition(new CameraPosition(position, zoom, bearing); to move the Camera to a specified bearing.