TomTom Maps for JavaScript
    Preparing search index...

    Type Alias LegSectionProps

    LegSectionProps: Omit<SectionProps, "startPointIndex" | "endPointIndex"> & {
        endPointIndex?: number;
        startPointIndex?: number;
        summary: LegSummary;
    }

    Route section representing a leg between waypoints.

    A leg is the portion of route between two consecutive non-circle waypoints. This is a top-level section that encompasses the entire journey segment.

    Type Declaration

    • OptionalendPointIndex?: number

      Index where this leg ends in the route coordinates.

      Only present if the route polyline geometry is available.

    • OptionalstartPointIndex?: number

      Index where this leg starts in the route coordinates.

      Only present if the route polyline geometry is available.

    • summary: LegSummary

      Summary statistics for this leg.

      Contains departure/arrival times, distances, durations, and consumption estimates specifically for this leg of the journey.

    Leg examples:

    • A→B route: 1 leg (A to B)
    • A→B→C route: 2 legs (A to B, then B to C)
    • A→B→(circle)→C route: 2 legs (A to B, then B to C) - circle waypoint doesn't create a leg
    const leg: LegSectionProps = {
    id: 'leg-1',
    summary: {
    departureTime: new Date(),
    arrivalTime: new Date(),
    lengthInMeters: 50000,
    travelTimeInSeconds: 3600,
    // ... other summary fields
    },
    startPointIndex: 0,
    endPointIndex: 250
    };