Class

MKOverlayPathRenderer

The visual representation for a path-based overlay.

Declaration

@interface MKOverlayPathRenderer : MKOverlayRenderer

Overview

Use this renderer when your overlay's shape is defined by a CGPath object. By default, this renderer fills the overlay's shape and represents the strokes of the path using its current attributes.

You can use this class as-is or subclass to define additional drawing behaviors. If you subclass, override the createPath method and use that method to build the appropriate path object. To change the path, invalidate it and recreate the path using whatever new data your subclass has obtained.

Topics

Creating and Managing the Path

path

The path representing the overlay’s shape.

- createPath

Creates the path for the overlay.

- invalidatePath

Updates the path associated with the overlay renderer.

Accessing the Drawing Attributes

fillColor

The fill color to use for the path.

strokeColor

The stroke color to use for the path.

lineWidth

The stroke width to use for the path.

lineJoin

The line join style to apply to corners of the path.

lineCap

The line cap style to apply to the open ends of the path.

miterLimit

The limiting value that helps avoid spikes at junctions between connected line segments.

lineDashPhase

The offset (in points) at which to start drawing the dash pattern.

lineDashPattern

An array of numbers specifying the dash pattern to use for the path.

Drawing the Path

- applyStrokePropertiesToContext:atZoomScale:

Applies the receiver’s current stroke-related drawing properties to the specified graphics context.

- applyFillPropertiesToContext:atZoomScale:

Applies the receiver’s current fill-related drawing properties to the specified graphics context.

- strokePath:inContext:

Draws a line along the specified path.

- fillPath:inContext:

Fills the area enclosed by the specified path.

shouldRasterize

A Boolean that determines if the overlay is rendered as a bitmap before compositing.

Relationships

Inherits From