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.-
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
POILocation
objects that represent the locations, metadata, and potential changes for the Points of Interest to be visualized or updated on the map. -
Remove
POILocation
s from the map if they were added before withdisplay(pois:)
.Declaration
Swift
func remove(pois: [POILocation])
Parameters
pois
An array of
POILocation
objects to be removed from the map. -
Removes all displayed Points of Interest (
POILocation
s) from the map.Declaration
Swift
func clear()
-
Adds an observer to the list of tap observers.
This allows external entities to observe and respond to tap events on
POILocation
instances. When aPOILocation
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
POITapObserver
protocol. -
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
POITapObserver
protocol to be removed.