Array

extension Array where Element == RoutePoint

Available where Element == RoutePoint

  • Finds Segment at given distance along the route.

    Declaration

    Swift

    public func segmentForDistance(distanceAlongRoute: Measurement<UnitLength>) -> Segment?

    Parameters

    distanceAlongRoute

    A distance along the route.

    Return Value

    Segment at a given distance along the route. If the given distance is smaller than 0, then returns Segment composed of the first two points of the Route. If the given distance is greater than total length of the route, then returns Segment composed of the last two points of the Route.