---
title: "insertOverlay(_:at:level:)"
framework: mapkit
role: symbol
role_heading: Instance Method
path: "mapkit/mkmapview/insertoverlay(_:at:level:)"
---

# insertOverlay(_:at:level:)

Inserts an overlay object into the level at the specified index.

## Declaration

```swift
func insertOverlay(_ overlay: any MKOverlay, at index: Int, level: MKOverlayLevel)
```

## Parameters

- `overlay`: The overlay object to insert.
- `index`: The index at which to insert the overlay object. If this value is greater than the number of objects in the doc://com.apple.mapkit/documentation/MapKit/MKMapView/overlays property, this method appends the object to the end of the array.
- `level`: The map level at which to place the overlay. For a list of possible values for this parameter, see doc://com.apple.mapkit/documentation/MapKit/MKOverlayLevel.

## Discussion

Discussion Inserting an overlay at a specific level places that overlay’s visual representation in front of or behind other map content such as map labels and point-of-interest icons.

## See Also

### Adding and inserting overlays

- [addOverlay(_:level:)](mapkit/mkmapview/addoverlay(_:level:).md)
- [addOverlays(_:level:)](mapkit/mkmapview/addoverlays(_:level:).md)
- [addOverlay(_:)](mapkit/mkmapview/addoverlay(_:).md)
- [addOverlays(_:)](mapkit/mkmapview/addoverlays(_:).md)
- [insertOverlay(_:at:)](mapkit/mkmapview/insertoverlay(_:at:).md)
- [insertOverlay(_:above:)](mapkit/mkmapview/insertoverlay(_:above:).md)
- [insertOverlay(_:below:)](mapkit/mkmapview/insertoverlay(_:below:).md)
- [exchangeOverlay(_:with:)](mapkit/mkmapview/exchangeoverlay(_:with:).md)
- [exchangeOverlay(at:withOverlayAt:)](mapkit/mkmapview/exchangeoverlay(at:withoverlayat:).md)
