TomTom Maps for JavaScript
    Preparing search index...

    Type Alias GeometrySearchParams

    GeometrySearchParams: CommonSearchParams<
        GeometrySearchRequestAPI,
        GeometrySearchResponseAPI,
    > & { geometries: SearchGeometryInput[] }

    Parameters for searching places within specific geographic areas (geometry search).

    Geometry search finds places that fall within or near the boundaries of one or more geometric shapes (polygons, circles, or multipolygons). This enables area-based searches like "restaurants in this neighborhood" or "hotels within these city boundaries".

    Type Declaration

    • geometries: SearchGeometryInput[]

      List of geometries to search within.

      Can be a mix of polygons, multipolygons, circles, or geometry feature collections from previous search results. Places that fall within or near these geometries will be returned.

      Also referred to as "geometryList" in API documentation.

      Supported Types:

      • Circle - Circular search area with radius
      • Polygon - Custom polygon boundary (GeoJSON)
      • MultiPolygon - Multiple polygon areas (GeoJSON)
      • PolygonFeatures - Feature collection with polygon geometries
      // Multiple geometries
      geometries: [
      { type: 'Circle', coordinates: [4.9, 52.3], radius: 500 },
      { type: 'Polygon', coordinates: [[...]] }
      ]

    Key Features:

    • Search within multiple geometries simultaneously
    • Supports polygons, multipolygons, and circles
    • Can use geometries from previous search results
    • Combines with text queries for filtered results

    Use Cases:

    • Find POIs within administrative boundaries
    • Search within custom drawn areas on map
    • Filter results to specific neighborhoods or regions
    • Proximity searches using circles
    // Search within a circular area
    const results = await search({
    key: 'your-api-key',
    query: 'restaurant',
    geometries: [{
    type: 'Circle',
    coordinates: [4.9041, 52.3676],
    radius: 1000 // meters
    }]
    });
    // Search within a polygon
    const results = await search({
    key: 'your-api-key',
    query: 'parking',
    geometries: [{
    type: 'Polygon',
    coordinates: [[
    [4.88, 52.36],
    [4.90, 52.36],
    [4.90, 52.38],
    [4.88, 52.38],
    [4.88, 52.36]
    ]]
    }]
    });