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

    Type Alias TrafficIncidentDetailsByPolygonParams

    TrafficIncidentDetailsByPolygonParams: TrafficIncidentDetailsBaseParams & {
        bbox?: never;
        ids?: never;
        polygon:
            | Polygon
            | MultiPolygon
            | Feature<Polygon | MultiPolygon>
            | FeatureCollection<Polygon | MultiPolygon>;
    }

    Parameters for fetching incidents within a polygon, such as a city boundary.

    Type Declaration

    The API only accepts a bounding box, so the request is sent with the polygon's bounding box and the response is then trimmed to the incidents that intersect the polygon. A LineString incident that crosses the boundary is kept. The 10,000 km² limit applies to that bounding box.

    const place = await geocodeOne('Amsterdam');
    const params: TrafficIncidentDetailsByPolygonParams = {
    polygon: await geometryData({ geometries: [place] })
    };