Path class Core

Represents a path object containing an ordered list of geographic coordinates.

A Path can be constructed from an in-memory list of Coordinates or by importing a binary file (GPX, KML, GeoJSON, etc.). It provides read-only access to its coordinates and waypoints and utility methods for cloning, exporting and converting to landmarks.

See also:

  • PathFileFormat for supported import/export formats.
  • MapViewPathCollection for displaying multiple paths on a map.

Constructors

Path.create({required Uint8List data, PathFileFormat format = PathFileFormat.gpx})
Creates a Path by importing binary data in a supported format.
factory
Path.fromCoordinates(List<Coordinates> coords)
Create a path from a list of coordinates.
factory
Path.fromCoordinatesWaypoints({required List<Coordinates> coordinates, required List<int> waypoints})
Create a path from list of coordinates and waypoints.
factory

Properties

area RectangleGeographicArea
Get path rectangle.
no setter
coordinates List<Coordinates>
Get read-only access to the internal coordinates list.
no setter
hashCode int
The hash code for this object.
no setterinherited
name String
Get path name.
getter/setter pair
pointerId int
The pointer ID of the native object
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
wayPoints List<int>
Get read-only access to the internal waypoint list.
no setter

Methods

cloneReverse() Path
Clone reverse order path. Does not change the original path. Returns a new Path with the coordinate order reversed.
cloneStartEnd(Coordinates start, Coordinates end) Path
Clone path from the given coordinates.
dispose() → void
Disposes the native object.
inherited
exportAs(PathFileFormat pathFileFormat) String
Export path coordinates in the requested data format.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerAutoReleaseObject(int pointerId) → void
Registers an object for auto release.
inherited
toLandmarkList() List<Landmark>
Create a new landmark list from a path.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

getCoordinatesAtPercent(List<Coordinates> coords, double percent) Coordinates
Get a coordinate along the path given by a fraction of the path length between 0.0 (departure point) and 1.0 (destination).