Reputation: 23
I'm working with xamarin forms to create an app. I am using Xamarin.Forms.Maps and I want to center the map in one position and then rotate the point of view by keeping the center of the map. In other words, I want to rotate the compass (360 degrees) to change the angle of the view every second, without changing the center of the map.
I center the map:
MyMap.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(this.viewModel.CentroTrasfusionale.Latitudine, this.viewModel.CentroTrasfusionale.Longitudine), Distance.FromMiles(0.14)));
But If I used
MyMap.Rotate(10);
rotates the layout of the map, not the point of view of the map
Upvotes: 2
Views: 1241
Reputation: 9274
You could use this Google Maps API.It is support to bearing
// No animation
await map.MoveCamera(CameraUpdateFactory.NewCameraPosition(
new CameraPosition(
new Position(35.7104, 139.8093), // center
17d, // zoom
45d, // bearing(rotation)
60d))); // tilt
// With animation
await map.AnimateCamera(CameraUpdateFactory.NewCameraPosition(
new CameraPosition(
new Position(35.7104, 139.8093), // center
17d, // zoom
45d, // bearing(rotation)
60d)), // tilt
TimeSpan.FromSeconds(1));
Upvotes: 2