1

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 Answers1

0

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

NativeMap.UserLocation.Title = "";

Regards ;)

G Clovs
  • 2,442
  • 3
  • 19
  • 24
  • In Swift it will be mapView.userLocation.title = ""; – G Clovs Jul 24 '20 at 09:20
  • Do you remember that you already got this identical answer deleted by an elected moderator? With the comment: Please don't post identical answers to multiple questions. Instead, tailor the answer to the question asked. If the questions are exact duplicates of each other, please vote/flag to close instead. – Yunnosch Aug 25 '20 at 19:29