Contents

CPPointOfInterestTemplate

A template that displays a map with selectable points of interest.

Declaration

@MainActor class CPPointOfInterestTemplate

Overview

The Point of Interest template displays selectable instances of CPPointOfInterest as annotations on the template’s map, and as items in a scrollable picker that the template overlays on the map. When the user selects a point of interest, the template displays a detail card that contains secondary information and optional actions the user can perform. The template manages clustering points of interest, selecting a point of interest, and zooming and panning the map.

To create a Point of Interest template, you call the init(title:pointsOfInterest:selectedIndex:) method and provide an array of CPPointOfInterest objects to display in the template’s map. Then call your interface controller’s pushTemplate(_:animated:completion:) method to push it onto the navigation hierarchy, or add the template as a tab in your CPTabBarTemplate.

You must create an object that implements the CPPointOfInterestTemplateDelegate protocol and set it as the template’s delegate using the pointOfInterestDelegate property. The template informs its delegate about changes to the map’s visible region so you can update the points of interest the map displays.

Topics

Creating a Point of Interest Template

Handling Template Events

Managing the Picker’s Title

Managing the Points of Interest

See Also

Location and Information