예제 #1
0
        protected override IMKAnnotation CreateAnnotation(Pin pin)
        {
            if (pin is SKPin)
            {
                IMKAnnotation result = new SKPinAnnotation(pin as SKPin);

                pin.Id = result;

                return(result);
            }

            return(base.CreateAnnotation(pin));
        }
예제 #2
0
        private MKAnnotationView GetViewForPin(MKMapView mapView, IMKAnnotation annotation)
        {
            SKPinAnnotation skiaAnnotation = annotation as SKPinAnnotation;

            if (skiaAnnotation != null)
            {
                SKPin pin = skiaAnnotation.SharedPin;
                SKPinAnnotationView pinView = mapView.DequeueReusableAnnotation(SKPinAnnotationView.ViewIdentifier) as SKPinAnnotationView
                                              ?? CreateAnnotationView(skiaAnnotation);

                pinView.Annotation = skiaAnnotation;
                pinView.UpdateImage();
                pinView.UpdateAnchor();
                pinView.Hidden  = !pin.IsVisible;
                pinView.Enabled = !pin.Clickable;

                return(pinView);
            }

            return(null);
        }
예제 #3
0
 public SKPinAnnotationView(SKPinAnnotation annotation) : base(annotation, ViewIdentifier)
 {
     _screenDensity = UIScreen.MainScreen.Scale;
 }
예제 #4
0
 private SKPinAnnotationView CreateAnnotationView(SKPinAnnotation skiaAnnotation)
 {
     return(new SKPinAnnotationView(skiaAnnotation));
 }