MapKit.MKOverlayRenderer Class
The visual representation of a MapKit.MKOverlay.

See Also: MKOverlayRenderer Members

Syntax

[Foundation.Register("MKOverlayRenderer", true)]
[ObjCRuntime.Availability(Introduced=ObjCRuntime.Platform.Mac_10_0 | ObjCRuntime.Platform.Mac_10_1 | ObjCRuntime.Platform.Mac_10_2 | ObjCRuntime.Platform.Mac_10_3 | ObjCRuntime.Platform.Mac_10_4 | ObjCRuntime.Platform.Mac_10_5 | ObjCRuntime.Platform.Mac_10_6 | ObjCRuntime.Platform.Mac_10_7 | ObjCRuntime.Platform.Mac_10_8 | ObjCRuntime.Platform.Mac_10_9 | ObjCRuntime.Platform.Mac_10_10 | ObjCRuntime.Platform.Mac_Version | ObjCRuntime.Platform.Mac_Arch64 | ObjCRuntime.Platform.Mac_Arch)]
[ObjCRuntime.Availability(Introduced=ObjCRuntime.Platform.iOS_7_0)]
public class MKOverlayRenderer : Foundation.NSObject

Remarks

This class, introduced in iOS 7, replaces MapKit.MKOverlayView. It has higher performance and renders the overlay beneath map labels. The map-related methods are the same as that of MapKit.MKOverlayView.

iOS distinguishes between the MapKit.MKOverlay, which represents the geometry of an overlay, and it's visual presentation. Prior to iOS 7, overlays were rendered using MapKit.MKOverlayViews. In iOS 7, these classes have been deprecated, and overlays now use the more efficient subclasses of MapKit.MKOverlayRenderer.

To create an overlay and its renderer, application developers must add the overlay to the MapKit.MKMapView and return the renderer either using the MKMapView.OverlayRenderer property or by overriding the MKMapViewDelegate.OverlayRenderer method.

C# Example

MKPolygon hotelOverlay = MKPolygon.FromCoordinates(coordinates);
mkMap.AddOverlay (hotelOverlay);
var polygon = MKPolygon.FromCoordinates(coordinates);
var renderer = new MKPolygonRenderer(polygon) { FillColor = UIColor.Red, Alpha = 0.5f };
mkMap.OverlayRenderer = (view, overlay) => renderer;
          

Related content

Requirements

Namespace: MapKit
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: 0.0.0.0