---
title: "strokePath(_:in:)"
framework: mapkit
role: symbol
role_heading: Instance Method
path: "mapkit/mkoverlaypathrenderer/strokepath(_:in:)"
---

# strokePath(_:in:)

Draws a line along the specified path.

## Declaration

```swift
func strokePath(_ path: CGPath, in context: CGContext)
```

## Parameters

- `path`: The path to draw.
- `context`: The graphics context in which to draw the path.

## Discussion

Discussion You must set the current stroke color before calling this method. Typically you do this by calling the applyStrokeProperties(to:atZoomScale:) method prior to drawing. If the strokeColor property is currently nil, this method does nothing.

## See Also

### Drawing the path

- [applyStrokeProperties(to:atZoomScale:)](mapkit/mkoverlaypathrenderer/applystrokeproperties(to:atzoomscale:).md)
- [applyFillProperties(to:atZoomScale:)](mapkit/mkoverlaypathrenderer/applyfillproperties(to:atzoomscale:).md)
- [fillPath(_:in:)](mapkit/mkoverlaypathrenderer/fillpath(_:in:).md)
- [shouldRasterize](mapkit/mkoverlaypathrenderer/shouldrasterize.md)
