fromLocations

final HyperTrack.Destination.Polygon fromLocations(List<HyperTrack.Location> locations)

Creates a polygon from an array of locations.

  • Collapses the first and last coordinate into startAndClosurePoint if they are equal.

  • If the first and last differ, uses the first element as startAndClosurePoint.

  • Requires at least three coordinates (start, second, third). Returns null otherwise.