GeoPoint class

A geographic point on Earth.

Both latitude and longitude should be between -180.0 (inclusive) and 180.0 (inclusive).

Examples:

final sanFrancisco = GeoPoint(37.7749, -122.4194);
final london = GeoPoint(51.5074, -0.1278);
final distance = sanFrancisco.distanceTo(london);
Implemented types

Constructors

GeoPoint(double latitude, double longitude)
Constructs a geographical point with latitude and longitude. [...]
const

Properties

hashCode int
The hash code for this object. [...]
read-only, override
isValid bool
Tells whether the geographical point appears to be valid.
read-only
latitude double
Latitude. Should be in the range -180.0 <= value <= 180.0.
final
longitude double
Longitude. Should be in the range -180.0 <= value <= 180.0.
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

compareTo(GeoPoint other) int
Compares this object to another Comparable [...]
override
distanceTo(GeoPoint other) double
Calculates distance (in meters) to another geographical point. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
override

Operators

operator ==(dynamic other) bool
The equality operator. [...]
override

Constants

zero → const GeoPoint
GeoPoint(0.0, 0.0).
GeoPoint(0.0, 0.0)