POIVisualization
public protocol POIVisualization
A protocol that provides methods to visualize Points of Interest (POILocations) 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 (
POILocations) on the map.For each
POILocationin 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
poisAn array of
POILocationobjects that represent the locations, metadata, and potential changes for the Points of Interest to be visualized or updated on the map. -
Remove
POILocations from the map if they were added before withdisplay(pois:).Declaration
Swift
func remove(pois: [POILocation])Parameters
poisAn array of
POILocationobjects to be removed from the map. -
Removes all displayed Points of Interest (
POILocations) 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
POILocationinstances. When aPOILocationis 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
observerAn object that conforms to the
POITapObserverprotocol. -
Removes an observer from the list of tap observers.
The specified observer no longer receives notifications of tap events on
POILocationinstances.Declaration
Swift
func removeTapObserver(_ observer: POITapObserver)Parameters
observerAn object that conforms to the
POITapObserverprotocol to be removed.
TomTom SDK for iOS (0.53.1)
POIVisualization