Coordinate class

A Coordinate Data Model independent of any other external libraries. Contains a double Latitude, a double Longitude value and a double Altitude value.

Should be easily convertible to a LatLng, GeoPoint etc for use in projects.

Constructors

Coordinate({required double latitude, required double longitude, double? altitude = 0})
Generates a coordinate from a latitude and longitude.
const
Coordinate.fromJson(Map<String, dynamic> json)
Generates a Coordinate from a Map having String keys 'latitude' and 'longitude', respectively each having double values.
factory
Coordinate.fromList(List json)
Generates a Coordinate from a List having double values.
factory

Properties

altitude double?
The altitude of the coordinate.
final
hashCode int
The hash code for this object.
no setteroverride
latitude double
The latitude of the coordinate.
final
longitude double
The longitude of the coordinate.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Returns a Map having String keys 'latitude' and 'longitude', respectively having latitude and longitude as double values.
toList() List<double>
Returns a List having double values. longitude and latitude are the first two values respectively. altitude is the third value if it exists (otherwise it is 0.0).
toString() String
A string representation of this object.
override

Operators

operator +(Coordinate other) Coordinate
Adding two coordinates.
operator -(Coordinate other) Coordinate
Subtracting two coordinates.
operator ==(Object other) bool
The equality operator.
override