How to disable click on MKUserLocation?

183 Views Asked by At

I am using MKMapView in my Xamarin.IOS project. I have some customs annotation around userLocation. Once those annotations placed they can't be easily clicked because of userLocation bluedot. I need userLocation as well what I want is just disable userLocation dot.

I have tried this

  public override void DidAddAnnotationViews(MKMapView mapView, MKAnnotationView[] views)
    {
        for (int i = 0; i < views.Count(); i++){
            if(views[i].Annotation is MKUserLocation){
                views[i].CanShowCallout = false;
                views[i].UserInteractionEnabled = false;
                views[i].Enabled = false;
                //MKMoernUserLocationView;
            }
        }

     }

views[] has 1 count at the begining but the condition doesn't meet. Has anyone got any idea what bit of piece i missed?

1

There are 1 best solutions below

2
G Clovs On

Hey there is an easy solution for .Net for iOS (Xamarin.iOS)

NativeMap.UserLocation.Title = "";

Regards ;)