Contents

mapView(_:rendererFor:)

Asks the delegate for a renderer object to use when drawing the specified overlay.

Declaration

optional func mapView(_ mapView: MKMapView, rendererFor overlay: any MKOverlay) -> MKOverlayRenderer

Parameters

  • mapView:

    The map view that requests the renderer object.

  • overlay:

    The overlay object that the map view is about to display.

Return Value

The renderer to use when presenting the specified overlay on the map.

Discussion

Implement this method and use it to provide an appropriate renderer object for your overlays. The renderer object is responsible for drawing the contents of your overlay when the map view requests it to. MapKit supports many different types of standard renderer objects and you may also define your own custom renderers.

See Also

Managing the display of overlays