4

I want to draw an overlay on top of my MKMapView So I defined this delegate class for defining the view of overlays. but as you can see it seems that from iOS 7 it is recommended that we use GetRendererForOverlay instead of GetViewForOverlay. The problem is that I can not find any method by name GetRendererForOverlay for override. In better word it seems that MKMapViewDelegate has not any virtual method for overriding GetRendererForOverlay. So how should we use it?

public class myMapDelegat : MKMapViewDelegate {


    [Obsolete ("Since iOS 7 it is recommnended that you use GetRendererForOverlay")]
    public override MKOverlayView GetViewForOverlay (MKMapView mapView, NSObject overlay)
    {
        // NOTE: Don't call the base implementation on a Model class
        // see http://docs.xamarin.com/guides/ios/application_fundamentals/delegates,_protocols,_and_events
        throw new NotImplementedException ();
    }

}

I read the document that has been suggested on the NOTE but I do not find any thing about GetRendererForOverlay.

Husein Behboudi Rad
  • 5,434
  • 11
  • 57
  • 115

1 Answers1

0

you also can you the method GetViewForOverlay for iOS7. But you also need call

var circleOverlay = MKCircle.Circle (mapView.CenterCoordinate, 1000);
mapView.AddOverlay (circleOverlay);

somewhere else to fire the above method.

lee
  • 7,955
  • 8
  • 44
  • 60