private MKAnnotationView GetViewForCustomPinAnnotation(CustomPinAnnotation annotation) { var annotationView = _nativeMap.DequeueReusableAnnotation(CustomPinAnnotationView.CustomReuseIdentifier) as CustomPinAnnotationView; if (annotationView == null) { annotationView = new CustomPinAnnotationView(annotation, annotation.CustomPin); annotationView.OnClose += OnIncidentInfoWindowClose; annotationView.OnNavigationRequested += OnIncidentInfoNavigationRequest; } else { annotationView.Pushpin = annotation.CustomPin; } return(annotationView); }
protected override void AddPushpinToMap(CustomPin pin) { try { var annotation = new CustomPinAnnotation(new CLLocationCoordinate2D { Latitude = pin.Latitude, Longitude = pin.Longitude }, pin); _nativeMap.AddAnnotation(annotation); if (annotation.CustomPin.Duration.HasValue) { ShowPushpinInformationPanel(annotation.CustomPin); } } catch (Exception ex) { Debug.WriteLine(ex.Message); } }