Instance Method

addOverlays(_:)

Adds an array of overlay objects to the map.

Declaration

func addOverlays(_ overlays: [MKOverlay])

Parameters

overlays

An array of objects, each of which must conform to the MKOverlay protocol.

Discussion

The specified objects are added to the group of overlay objects in the aboveLabels level. Adding an overlay causes the map view to begin monitoring the area represented by that overlay. As soon as the bounding rectangle of the overlay intersects the visible portion of the map, the map view tries to draw the overlay. As soon as the bounding rectangle of an overlay intersects the visible portion of the map, the map view adds a corresponding overlay view to the map. The overlay view is provided by the mapView:viewForOverlay: method of the map view’s delegate object.

To remove multiple overlays from a map, use the removeOverlays(_:) method.

See Also

Adding and Inserting Overlays

func add(MKOverlay, level: MKOverlayLevel)

Adds the overlay object to the map at the specified level.

func addOverlays([MKOverlay], level: MKOverlayLevel)

Adds an array of overlay objects to the map at the specified level.

func add(MKOverlay)

Adds a single overlay object to the map.

func insert(MKOverlay, at: Int, level: MKOverlayLevel)

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

func insert(MKOverlay, at: Int)

Inserts an overlay object into the list associated with the map.

func insert(MKOverlay, above: MKOverlay)

Inserts one overlay object on top of another.

func insert(MKOverlay, below: MKOverlay)

Inserts one overlay object below another.

func exchangeOverlay(MKOverlay, with: MKOverlay)

Exchanges the positions of the two overlay objects.

func exchangeOverlay(at: Int, withOverlayAt: Int)

Exchanges the position of two overlay objects.