public virtual void OnDidSelectAnnotationView(object sender, MKAnnotationViewEventArgs e) { _lalitude = e.View.Annotation.Coordinate.Latitude; _longitude = e.View.Annotation.Coordinate.Longitude; MapViewIOS.AddAnnotations(new MKPointAnnotation() { Coordinate = new CLLocationCoordinate2D(_lalitude, _longitude) }); }
private void LongPress(UILongPressGestureRecognizer gesture) { MapViewIOS.RemoveAnnotations(MapViewIOS.Annotations); CGPoint touchPoint = gesture.LocationInView(MapViewIOS); CLLocationCoordinate2D touchMapCoordinate = MapViewIOS.ConvertPoint(touchPoint, MapViewIOS); MKAnnotationClass annotation = new MKAnnotationClass(); annotation.Coordinate2D = touchMapCoordinate; _lalitude = annotation.Coordinate2D.Latitude; _longitude = annotation.Coordinate2D.Longitude; ViewModel.LalitudeGoogleMarker = _lalitude; ViewModel.LongitudeGoogleMarker = _longitude; MapViewIOS.AddAnnotation(annotation); MapViewIOS.AddAnnotations(new MKPointAnnotation() { Coordinate = new CLLocationCoordinate2D(_lalitude, _longitude) }); }