<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MapKit",
  "identifier" : "/documentation/MapKit/MapContent/stroke(_:lineWidth:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "MapKit",
      "SwiftUI",
      "_MapKit_SwiftUI"
    ],
    "preciseIdentifier" : "s:15_MapKit_SwiftUI0A7ContentPAAE6stroke_9lineWidthQrqd___14CoreFoundation7CGFloatVt0cD010ShapeStyleRd__lF"
  },
  "title" : "stroke(_:lineWidth:)"
}
-->

# stroke(_:lineWidth:)

Applies the given shape style to drawn map overlays using the line width you specify.

```
@MainActor @preconcurrency func stroke(_ content: some ShapeStyle, lineWidth: CGFloat = 1) -> some MapContent
```

## Parameters

`content`

The shape style to apply.

`lineWidth`

The line width to draw the stroke with.

## Return Value

Returns [`MapContent`](/documentation/MapKit/MapContent) drawn with the <doc://com.apple.documentation/documentation/SwiftUI/ShapeStyle> and `lineWidth` you specified.

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)