GeoPosition class

Position coordinated in Degrees (i.e. GPS-style).

Inheritance
  • Object
  • Serializable
  • GeoPosition
Annotations
  • @JsonSerializable(fieldRename: FieldRename.snake, includeIfNull: false)

Constructors

GeoPosition(double latitude, double longitude)
GeoPosition.fromJson(Map<String, dynamic> json)
factory
GeoPosition.fromLocation(LocationData location)

Properties

$type String?
The runtime class name (type) of this object. Used for deserialization from JSON objects.
getter/setter pairinherited
fromJsonFunction Function
The function which can convert a JSON string to an object of this type.
no setteroverride
hashCode int
The hash code for this object.
no setteroverride
jsonType String
Return the __type to be used for JSON serialization of this class. Default is runtimeType. Only specify this if you need another type.
no setterinherited
latitude double
Latitude in GPS coordinates.
final
longitude double
Longitude in GPS coordinates.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

degToRad(num deg) double
Convert degrees to radians.
distanceTo(GeoPosition destination) double
Returns the approximate distance in meters between this location and the given location.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
radToDeg(num rad) double
Convert radians to degrees.
toJson() Map<String, dynamic>
Return a JSON encoding of this object.
override
toString() String
A string representation of this object.
override

Operators

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

Constants

earthRadius → const double
Earth radius in km.