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

    Type Alias SearchSuggestionsParams

    SearchSuggestionsParams: CommonServiceParams & {
        filters?: {
            areaTypes?: NonNullable<PlaceFilters["geographyTypes"]>;
            boundingBox?: HasBBox;
            countries?: NonNullable<GeographicFilters["countries"]>;
            kinds?: SearchSuggestionKind[];
            poiTypes?: NonNullable<PlaceFilters["poiCategories"]>;
        };
        geoBias?: Pick<PointGeoBias, "position">;
        limit?: number;
        query: string;
    }

    Parameters for getSearchSuggestions.

    Type Declaration

    • Optionalfilters?: {
          areaTypes?: NonNullable<PlaceFilters["geographyTypes"]>;
          boundingBox?: HasBBox;
          countries?: NonNullable<GeographicFilters["countries"]>;
          kinds?: SearchSuggestionKind[];
          poiTypes?: NonNullable<PlaceFilters["poiCategories"]>;
      }

      What the result set is restricted to.

      • OptionalareaTypes?: NonNullable<PlaceFilters["geographyTypes"]>

        Geography types to restrict area results to.

        Setting it leaves only areas among the search results: no place, address or street.

      • OptionalboundingBox?: HasBBox

        Restricts results to a box. How it combines with geoBias is on getSearchSuggestions.

      • Optionalcountries?: NonNullable<GeographicFilters["countries"]>

        Countries to restrict to, as ISO 3166-1 alpha-2 or alpha-3 codes.

      • Optionalkinds?: SearchSuggestionKind[]

        Which kinds of result to return. Omit it for every kind.

      • OptionalpoiTypes?: NonNullable<PlaceFilters["poiCategories"]>

        POI categories to restrict place results to. A parent code also matches its sub-categories.

        Setting it leaves only places among the search results: no address, street or area.

    • OptionalgeoBias?: Pick<PointGeoBias, "position">

      The point to search around.

      position ranks nearer results higher without excluding anything, and is what distanceInMeters is measured from. It is only a point. filters.boundingBox restricts the results, and with a box set the position ranks no places, it only measures them.

    • Optionallimit?: number

      Maximum results in the list.

      5
      

      At least 1 and at most 10: a value outside that range is raised or capped to it.

    • query: string

      What the user typed, which can be a partial or a complete query.

    They follow Places Search v3's suggest body, with filters for what narrows the result set and geoBias.position for the point to search around.