Skip to content

Commit

Permalink
Document along behaviour when distance is outside line length range
Browse files Browse the repository at this point in the history
  • Loading branch information
leiflinse-trivector committed Jan 12, 2024
1 parent acbc64d commit 75d34f2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/src/along.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import 'package:turf/destination.dart';
import 'package:turf/helpers.dart';
import 'package:turf/src/distance.dart' as measure_distance;

/// Takes a [line] and returns a [Point] at a specified distance along the line.
/// Takes a [line] and returns a [Point] at a specified [distance] along the line.
///
/// If [distance] is less than 0, the line start point is returned
/// If [distance] is larger than line length, the end point is returned
Point? along(LineString line, num distance, [Unit unit = Unit.kilometers]) {
// Get Coords
final coords = line.coordinates;
Expand Down

0 comments on commit 75d34f2

Please sign in to comment.