TomTom Maps for JavaScript
    Preparing search index...

    Class ViewportPlaces

    A class for managing dynamic searched place modules on a TomTom map.

    It leverages the SDK search service to maintain place modules that automatically update and stay current as the map viewport changes.

    Index

    Constructors

    • Creates an instance of ViewportPlaces bound to a TomTom map.

      Parameters

      • map: TomTomMap

        The TomTom map instance to attach place modules to.

      Returns ViewportPlaces

    Methods

    • Adds a PlacesModule that displays places based on fuzzy search parameters and automatically updates as the map moves.

      Parameters

      Returns Promise<PlacesModule>

      A promise that resolves to the PlacesModule instance managing the module.

      • Each call to "add" creates a new place module and places it above previously added modules.
      • Place modules are rendered bottom-up in the order they are added: the first added module is displayed at the bottom, and later modules are stacked on top of earlier ones.
      • The default places module theme is 'base-map' unless overridden in the options.
    • Adds a PlacesModule for specific POI categories that updates automatically as the map moves. The POIs are shown in the same style as the base map.

      Parameters

      Returns Promise<PlacesModule>

      A promise that resolves to the PlacesModule instance managing the module.

      • This is a convenience wrapper over add that configures a category-based search for a PlacesModule.
      • Each call creates a new place module that will be stacked on top of previously added modules.
    • Removes a specific place module by its ID, stopping its updates and clearing the displayed places.

      Parameters

      • id: string

        The unique identifier of the PlacesModule to remove.

      Returns void

      If the id does not exist, an error is logged into console.

    • Removes all registered place modules, stopping their updates and clearing all displayed places.

      Returns void

    • Updates the search and display options for an existing place module identified by its ID. This will immediately apply the new options and refresh the place module accordingly.

      Parameters

      Returns Promise<void>

      Error if the place module with the given ID does not exist.