This is the documentation of version 1.0.0-rc.2. Go to the latest version, 1.0.0-rc.5.
TomTom Maps for JavaScript
    Preparing search index...

    Function getPOICategories

    • Retrieves the list of POI category types supported by the TomTom Search API.

      The returned code values (POICategory) serve two purposes:

      • Pass to discoverPlaces({ filters: { poiCategories } }) to filter search results by category.
      • Pass as POIsModule filters.categories to filter the map's built-in POI icons. Generic parent codes (e.g. 'RESTAURANT') work there, but overly specific child codes (e.g. 'ITALIAN_RESTAURANT') don't, so use a parent or a POICategoryGroup instead.

      Results are cached in memory per language. The first call fetches from the API, and the cache serves all later calls, including filtered ones.

      Parameters

      Returns Promise<POICategoriesResponse>

      // All categories
      const { poiCategories: all } = await getPOICategories();

      // Filtered by keyword, best match first
      const { poiCategories: gyms } = await getPOICategories({ filters: ['gym'] });
      gyms.forEach(c => console.log(c.code, c.name, c.childCategoryCodes));