SearchVisualization

public protocol SearchVisualization

Entry point for all methods related to the search visualization. Instances of SearchVisualization are created using SearchVisualizationFactory.create(search:map:). You should call methods on these instances from the main thread only, otherwise an exception can occur. To use a SearchVisualization instance, first provide a route gemoetry and a SearchConfiguration with the SearchVisualization.displayPOIsAlongRoute(geometry:configuration) method. You can then call clear() to remove all the primitives that have been added to the map.

Important

This is a Public Preview API. It may be changed or removed at any time.
  • Displays Points of Interest (POIs) along a specified route with a given configuration.

    Declaration

    Swift

    func displayPOIsAlongRoute(
        geometry: [CLLocationCoordinate2D],
        configuration: SearchConfiguration,
        completion: @escaping (Result<[TomTomSDKPOIVisualization.POI], Error>) -> ()
    )

    Parameters

    geometry

    An array of CLLocationCoordinate2D that defines the route geometry.

    configuration

    The configuration for the POI search.

    completion

    A closure called upon completion. It returns a list of displayed POIs on success, or an error on failure.

  • Hides all POIs on the map that have been displayed with displayPOIsAlongRoute(geometry:)

    Declaration

    Swift

    func clear()