Class

MKOverlayPathView

Represents a generic overlay that draws its contents using a CGPathRef data type.

Declaration

@interface MKOverlayPathView : MKOverlayView

Overview

You can use this class to implement simple path-based overlay views or subclass it to define additional drawing behaviors. The default drawing behavior of this class is to apply the object’s current fill attributes, fill the path, apply the current stroke attributes, and then stroke the path.

If you subclass, you should override the createPath method and use that method to build the appropriate path for the overlay. You can invalidate this path as needed and force the path to be recreated using whatever new data your subclass has obtained.

In iOS 7 and later, use the MKOverlayPathRenderer class to display path-based overlays instead.

Topics

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 indicating the dash pattern for paths.

Creating and Managing the Path

path

The current path to use when drawing the overlay.

- createPath

Creates the path for the overlay.

- invalidatePath

Releases the path associated with the receiver.

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.

Relationships

Inherits From