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

    Type Alias CommonGeocodeAndFuzzySearchParams

    The parameters fuzzy search and geocoding share.

    They control search behaviour common to both, including autocomplete mode, pagination, and geographic filtering.

    Used by:

    type CommonGeocodeAndFuzzySearchParams = {
        cursor?: string;
        filters?: GeographicFilters;
        geoBias?: GeoBias;
        typeahead?: boolean;
    }
    Index
    cursor?: string

    The nextCursor of a previous response, to continue that search. Pass it back unchanged, with the same parameters. Leave it out for the first page.

    The value is opaque. Only the SDK mints and reads it, so the pagination mechanism can change without breaking callers. Passing a value this SDK did not produce throws.

    let response = await discoverPlaces({ query: 'cafe', limit: 20 });

    while (response.properties?.nextCursor) {
    response = await discoverPlaces({ query: 'cafe', limit: 20, cursor: response.properties?.nextCursor });
    }

    The countries results may come from, as GeographicFilters. Fuzzy search's filters also carries PlaceFilters, and geocoding's also carries geographyTypes.

    filters: { countries: ['NL', 'BE'] }
    
    geoBias?: GeoBias

    Where to look, as a point with an optional radius or as a bounding box.

    A point without radiusMeters biases the ranking. With a radius, or with a boundingBox, the results are confined to that area. To search without a geographic bias, leave it out.

    geoBias: { position: [4.9, 52.3], radiusMeters: 2000 }
    geoBias: { boundingBox: [4.8, 52.3, 5.0, 52.4] }
    typeahead?: boolean

    Whether to treat the query as incomplete text a user is typing, in predictive (autocomplete) mode.

    The search then returns suggestions that match the partial input.

    In autocomplete mode, the search:

    • Is optimised for real-time search-as-you-type
    • Returns results that start with or contain the query
    • Suits interactive search boxes
    • Lowers result quality thresholds to show more options

    In regular search (false), it:

    • Treats the query as complete input
    • Higher quality thresholds
    • Better for final search submission
    false
    
    // Autocomplete mode for "Amst" input
    typeahead: true // Returns: Amsterdam, Amstelveen, etc.

    // Regular search mode
    typeahead: false // Expects complete query