Пример #1
0
        public override MKAnnotationView GetViewForAnnotation(MKMapView mapView, IMKAnnotation annotation)
        {
            MKAnnotationView  annotationView = null;
            MKPointAnnotation anno           = null;

            if (annotation is MKUserLocation)
            {
                return(null);
            }
            else
            {
                anno = annotation as MKPointAnnotation;
            }

            string identifier = GetIdentifier(anno);

            if (identifier == "")
            {
                throw new Exception("No Identifier found for pin");
            }

            annotationView = mapView.DequeueReusableAnnotation(identifier);

            if (annotationView == null)
            {
                annotationView = new CustomMKPinAnnotationView(annotation, identifier);
            }

            //This removes the bubble that pops up with the title and everything
            ((CustomMKPinAnnotationView)annotationView).FormsIdentifier = identifier;
            annotationView.CanShowCallout = false;

            return(annotationView);
        }
		public override MKAnnotationView GetViewForAnnotation (MKMapView mapView, IMKAnnotation annotation)
		{
			MKAnnotationView annotationView = null;
			MKPointAnnotation anno = null;

			if (annotation is MKUserLocation) {
				return null; 
			} else {
				anno = annotation as MKPointAnnotation;
			}

			string identifier = GetIdentifier (anno);

			if (identifier == "")
				throw new Exception ("No Identifier found for pin");

			annotationView = mapView.DequeueReusableAnnotation (identifier);

			if (annotationView == null)
				annotationView = new CustomMKPinAnnotationView (annotation, identifier);

			//This removes the bubble that pops up with the title and everything
			((CustomMKPinAnnotationView)annotationView).FormsIdentifier = identifier;
			annotationView.CanShowCallout = false;

			return annotationView;
		}