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 TrafficAreaAnalyticsParams

    TrafficAreaAnalyticsParams: CommonServiceParams & TrafficAreaAnalyticsBaseParams & (
        TrafficAreaAnalyticsDateRange
        | TrafficAreaAnalyticsDays
    )

    The parameters of the Traffic Area Analytics Lite service.

    Supply either startDate (with an optional endDate) or days, as the two options are mutually exclusive.

    The lite endpoint runs the analysis synchronously and returns results immediately. The date range must not exceed 31 days, and you can submit only a single region.

    // Continuous range: an omitted endDate defaults to three days ago
    const result = await trafficAreaAnalytics({
    startDate: '2024-08-01',
    endDate: '2024-08-07',
    functionalRoadClasses: ['MOTORWAY', 'MAJOR_ROAD', 'OTHER_MAJOR_ROAD', 'SECONDARY_ROAD', 'LOCAL_CONNECTING_ROAD', 'LOCAL_ROAD_HIGH_IMPORTANCE'],
    hours: [7, 8, 9, 17, 18],
    metrics: ['speed', 'congestionLevel'],
    geometry: {
    type: 'Polygon',
    coordinates: [[[4.896128, 52.382402], [4.875701, 52.368459], [4.923611, 52.36341], [4.896128, 52.382402]]]
    }
    });
    // Specific dates
    const result = await trafficAreaAnalytics({
    days: ['2024-08-05', '2024-08-12', '2024-08-19', '2024-08-26'],
    functionalRoadClasses: ['MOTORWAY', 'MAJOR_ROAD', 'OTHER_MAJOR_ROAD'],
    hours: [8, 9, 17, 18],
    metrics: ['speed'],
    geometry: polygon
    });