Contents

addOverlays(_:)

Adds an array of overlay objects to the map.

Declaration

func addOverlays(_ overlays: [any MKOverlay])

Parameters

  • overlays:

    An array of objects, each of which needs to conform to the Mkoverlay protocol.

Discussion

The map view adds the specified objects to the group of overlay objects in the MKOverlayLevel.aboveLabels level. Adding an overlay causes the map view to begin monitoring the area that the overlay represents. As soon as the bounding rectangle of the overlay intersects the visible portion of the map, the map view tries to draw the overlay, or adds the corresponding overlay view to the map. Implement the mapView(_:rendererFor:) method of the map view’s delegate object to provide the overlay view.

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

See Also

Related Documentation

Adding and inserting overlays