POIVisualization
public protocol POIVisualization
A protocol that provides methods to visualize Points of Interest (POILocation
s) on a map interface using the TomTomMap
instance.
Instances of POIVisualization
are created using create(map:)
You should call methods on these instances from the main thread only, otherwise an exception can occur.
To use a POIVisualization
instance, first provide a list of POILocation
instances with the display(pois:)
method.
You can then call display(pois:)
or clear()
to remove the POILocation
instances that have been added to the map by POIVisualization
.
Important
This is a Public Preview API. It may be changed or removed at any time.Adds an observer to the list of tap observers.
This allows external entities to observe and respond to tap events on POILocation
instances. When a POILocation
is tapped, all registered
observers are notified. Observers are weakly referenced; ensure you maintain a strong reference to observers to
prevent them from being deallocated prematurely.
Declaration
Swift
func addTapObserver(_ observer: POITapObserver)
Parameters
observer
|
An object that conforms to the |
Removes all displayed Points of Interest (POILocation
s) from the map.
Declaration
Swift
func clear()
Displays or updates the provided Points of Interest (POILocation
s) on the map.
For each POILocation
in the provided array:
- If it doesn’t already exist on the map, it is added.
If it does exist and has updated metadata, it is replaced with the new data.
Declaration
Swift
func display(pois: [POILocation])
Parameters
pois
|
An array of |
Remove POILocation
s from the map if they were added before with display(pois:)
.
Declaration
Swift
func remove(pois: [POILocation])
Parameters
pois
|
An array of |
Removes an observer from the list of tap observers.
The specified observer no longer receives notifications of tap events on POILocation
instances.
Declaration
Swift
func removeTapObserver(_ observer: POITapObserver)
Parameters
observer
|
An object that conforms to the |