When i do max zoom and open again the map as FlyoutPage i have exception.
Video Link
When i do max zoom and open again the map as FlyoutPage i have exception.
Video Link
Could you show your code and clarify which line cause the error ?
It will be helpful if you provide us a basic , reproducible project to test .
My excaption:
"[0:] An error occurred: 'Object reference not set to an instance of an object.'. Callstack: ' at TestApp.iOS.CustomMapRenderer.GetCustomPin (MapKit.MKPointAnnotation annotation) [0x0001f] in C:\Users\Admin\source\repos\TestApp\TestApp\TestApp.iOS\CustomMapRenderer.cs:114 "
Code where was excaption:
CustomPin GetCustomPin(MKPointAnnotation annotation)
{
var position = new Position(annotation.Coordinate.Latitude, annotation.Coordinate.Longitude);
foreach (var pin in customPins)
{
if (pin.Position == position)
{
return pin;
}
}
return null;
}
I try to do like this:
https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/custom-renderer/map-pin
My code where i created pins(markers):
My method "GetViewForAnnotation" in class "CustomMapRenderer : MapRenderer" in iOS project:
Sorry, I test the sample and with your code but can't reproduce the crash .
Could you provide us a basic , reproducible project to test ?
In addition to this error, my pins were constantly confused (displayed incorrectly), but i removed this line:
if (annotationView == null)
In my method "GetViewForAnnotation" in class "CustomMapRenderer : MapRenderer" in iOS project:
Everything began to work for me much better
9 people are following this question.