public override void DidSelectAnnotationView(MKMapView mapView, MKAnnotationView view) { var pinAnnotationView = view; if (pinAnnotationView == null) { return; } if (_previouslySelectedNativePin != null) { ResetPrevioslySelectedPin(); } view.Image = UIImage.FromFile("defaultPin.png").Scale(new CGSize(40, 50)); var extendedMapAnnotation = pinAnnotationView.Annotation as ExtendedMapAnnotation; if (extendedMapAnnotation != null) { extendedMapAnnotation.AnnotationClicked(mapView); } _previouslySelectedPin = extendedMapAnnotation; _previouslySelectedNativePin = view; }
public override void DidSelectAnnotationView (MKMapView mapView, MKAnnotationView view) { var pinAnnotationView = view; if (pinAnnotationView == null) return; if(_previouslySelectedNativePin != null) ResetPrevioslySelectedPin(); view.Image = UIImage.FromFile("defaultPin.png").Scale(new CGSize(40,50)); var extendedMapAnnotation = pinAnnotationView.Annotation as ExtendedMapAnnotation; if (extendedMapAnnotation != null) { extendedMapAnnotation.AnnotationClicked (mapView); } _previouslySelectedPin = extendedMapAnnotation; _previouslySelectedNativePin = view; }
private void AddPin(ExtendedPin formsPin) { var nativePin = new ExtendedMapAnnotation(new CLLocationCoordinate2D(formsPin.Position.Latitude, formsPin.Position.Longitude), formsPin.Label, formsPin.Address, formsPin.PinIcon); nativePin.Clicked += HandleAnnotationClick; _nativeMapView.AddAnnotation(nativePin); }
private void HandleAnnotationClick(object sender, ExtendedMapAnnotation e) { _customMap.SelectedPinAddress = e.Subtitle; if (_customMapContentView.Footer.FooterMode == FooterMode.Hidden) { _customMapContentView.Footer.FooterMode = FooterMode.Minimized; } }