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

    Type Alias CommonSearchParams<ApiRequest, ApiResponse>

    CommonSearchParams: CommonPlacesParams<ApiRequest, ApiResponse> & {
        filters?: PlaceFilters;
        openingHours?: OpeningHoursMode;
        query?: string;
        relatedPois?: RelatedPoisRequest;
        timeZone?: TimeZoneRequest;
    }

    Common parameters for search services with POI filtering capabilities.

    Extends basic places parameters with the POI attribute filters — categories, brands, EV charging specifics — grouped under filters.

    Type Parameters

    • ApiRequest

      The API request type

    • ApiResponse

      The API response type

    Type Declaration

    • Optionalfilters?: PlaceFilters

      What kind of places may come back: see PlaceFilters.

    • OptionalopeningHours?: OpeningHoursMode

      Request opening hours information for POIs.

      Specifies the format and detail level of opening hours data included in the response.

      Opening Hours Modes: Different modes provide varying levels of detail about when a POI is open for business.

      Use Cases:

      • Display "Open Now" status
      • Show full weekly schedule
      • Plan visits during open hours
      • Filter to currently open locations
      // Request opening hours
      openingHours: 'nextSevenDays'
    • Optionalquery?: string

      Search query string.

      The text to search for — can be a place name, POI, address, or any free-form location query. When omitted, results are driven entirely by filters — a category, a brand, a fuel type — or by geometries on geometry search.

      Query Examples:

      • Place/POI names: "Eiffel Tower", "Starbucks"
      • General queries: "pizza near me", "gas station"
      • Partial inputs: "Amst" (for autocomplete / typeahead)

      The query is processed with fuzzy matching to handle typos and variations.

      // Text-driven search
      query: 'coffee shop'

      // Omit query to search purely by category
      filters: { poiCategories: ['CHARGING_LOCATION'] }
    • OptionalrelatedPois?: RelatedPoisRequest

      Include related POIs in the response.

      Some POIs have hierarchical relationships (e.g., terminal inside airport). This parameter controls which related POIs are included.

      Relationship Types:

      • off: No related POIs (default)
      • child: Include child POIs (e.g., terminals of an airport)
      • parent: Include parent POIs (e.g., airport of a terminal)
      • all: Include both parent and child relationships

      Use Cases:

      • Show all terminals when user searches for airport
      • Navigate from specific location to broader facility
      • Display hierarchical location structure
      • Provide alternative entry points
      'off'
      
      // Include child POIs
      relatedPois: 'child' // Airport → show terminals

      // Include parent POIs
      relatedPois: 'parent' // Terminal → show airport

      // Include all related POIs
      relatedPois: 'all'
    • OptionaltimeZone?: TimeZoneRequest

      Request timezone information for POI locations.

      Includes timezone data in the response, useful for scheduling and time-aware applications.

      Timezone Format:

      • iana: Returns IANA timezone identifier (e.g., "Europe/Amsterdam")

      Use Cases:

      • Display local time for POI
      • Schedule appointments across timezones
      • Calculate opening hours in local time
      • International business coordination
      // Request IANA timezone ID
      timeZone: 'iana'

    Used by discoverPlaces.

    Provides:

    • POI category, brand, EV charging and fuel type filters (filters)
    • Opening hours and timezone data
    • Related POI relationships