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

    Function isHairpin

    • Whether a curve is a hairpin: a bend of the road turning 140° or more on a radius of 40 m or less, as the numbered bends of a mountain pass do.

      Parameters

      • curve: Pick<
            CurveSectionProps,
            "headingChangeInDegrees"
            | "radiusInMeters"
            | "maneuver",
        >

      Returns boolean

      • A wider bend that turns as far, as where a valley road swings round a spur, is a horseshoe a driver takes at speed, and no hairpin.
      • A curve at a maneuver, as a roundabout or a turn at a junction, is no hairpin however far it turns.
      • A curvy stretch's hairpinCount counts its curves this says yes to.
      const hairpins = route.properties.sections.curve?.filter(isHairpin) ?? [];