I have a custom map in xamarin that i have custom renders in both iOS and Android.
The problem is in iOS when i navigate to a position and then rotate my device to landscape it moves my map center to what I think is lat 0, lon 0
Even if i set my map location when the map is first rendered it resets as soon as the orientation changes.
I use the following code to set the camera position
MKMapCamera cam = new MKMapCamera();
CLLocationCoordinate2D MyPosition;
MyPosition = Constants.centreLatLng
cam.Altitude = 1500;
cam.CenterCoordinate = MyPosition;
Constants.nativeMap.SetCamera(cam, false);
I want it so when i change the orientation my map center stays the same as what it was.
As you can see in the Xamarin official documentation for the MapKit, https://learn.microsoft.com/en-us/dotnet/api/mapkit.mkmapcamera?view=xamarin-ios-sdk-12 you can try to over ride the DidChange or DidChangeValue function and figure out what the latest value of the camera position is. So then you know what value to set OnSizeAllocated.
Also you might want to try initializing the values of the map shown in the example, because you shouldn't be having this problem.