Esempio n. 1
0
 public sealed override void DidSelectAnnotationView(MKMapView mapView, MKAnnotationView view)
 {
     if (view.Annotation is BindingMKAnnotation annotation)
     {
         if (MarkerClick?.CanExecute(annotation.Annotation) ?? false)
         {
             MarkerClick.Execute(annotation.Annotation);
             view.Selected = false;
         }
     }
     else if (view.Annotation is IBindingMKMapOverlay overlay)
     {
         if (OverlayClicked?.CanExecute(overlay.Annotation) ?? false)
         {
             OverlayClicked.Execute(overlay.Annotation);
             view.Selected = false;
         }
     }
     else if (view.Annotation == mapView.UserLocation)
     {
         var loc = view.Annotation.Coordinate.ToBinding2DLocation();
         if (MyLocationClick?.CanExecute(loc) ?? false)
         {
             MyLocationClick.Execute(loc);
             view.Selected = false;
         }
     }
 }
 public virtual void OnMapClick(LatLng point)
 {
     try
     {
         MarkerClick?.Execute(null);
     }
     catch { }
 }
Esempio n. 3
0
        public virtual bool OnMarkerClick(Marker marker)
        {
            var mAnnotation = (marker.Tag as AnnotationTag)?.Annotation;

            if (mAnnotation is IBindingMapAnnotation anno &&
                (MarkerClick?.CanExecute(anno) ?? false))
            {
                MarkerClick.Execute(anno);
                return(true);
            }
            return(false);
        }
        public virtual bool OnMarkerClick(Marker marker)
        {
            try
            {
                MarkerClick?.Execute(MarkerSet.GetRawItem(marker));
                return(true);
            }
            catch
            {
            }

            return(false);
        }