Waypath class

A mutable container for a single path of a way, which is a list of ILatLong coordinates.

This class provides methods for manipulating the path, such as adding, inserting, and removing points. It also caches properties like the bounding box and whether the path is closed to improve performance.

Constructors

Waypath({required List<ILatLong> path})
Creates a new Waypath with the given path.
Waypath.empty()
Creates a new, empty Waypath.

Properties

boundingBox BoundingBox
The bounding box of the path.
no setter
first ILatLong
The first point in the path.
no setter
hashCode int
The hash code for this object.
no setterinherited
isEmpty bool
Returns true if the path is empty.
no setter
isNotEmpty bool
Returns true if the path is not empty.
no setter
last ILatLong
The last point in the path.
no setter
length int
The number of points in the path.
no setter
path List<ILatLong>
A read-only view of the path.
no setter
pathForModification List<ILatLong>
Returns the underlying list of points for modification.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(ILatLong latLong) → void
Adds a point to the end of the path.
addAll(Iterable<ILatLong> latLongs) → void
Adds all points from the given iterable to the end of the path.
clear() → void
Removes all points from the path.
clone() Waypath
Creates a deep copy of this Waypath.
contains(ILatLong latLong) bool
Returns true if the path contains the given latLong.
insert(int index, ILatLong latLong) → void
Inserts a point at the given index.
insertAll(int index, Iterable<ILatLong> latLongs) → void
Inserts all points from the given iterable at the given index.
isClosedWay() bool
Returns true if the path is a closed way (the first and last points are the same).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeAt(int index) → void
Removes the point at the given index.
sublist(int start, [int? end]) List<ILatLong>
Returns a new list containing a subset of the path.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited