LatLong class

Immutable geographic coordinate representing a point on Earth's surface.

This class stores latitude and longitude values in decimal degrees using the WGS84 coordinate system. It provides conversion utilities for microdegrees (degrees * 10^6) and supports parsing from various string formats.

Key features:

  • Immutable design for thread safety
  • WGS84 coordinate system compliance
  • Microdegree conversion for high-precision storage
  • String parsing with multiple separator support
  • Efficient equality comparison and hashing
Implemented types

Constructors

LatLong(double latitude, double longitude)
Creates a new LatLong with the specified coordinates in decimal degrees.
const

Properties

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

Methods

getLatitude() → double?
Gets the latitude value in decimal degrees.
getLatitudeE6() → int
Gets the latitude value in microdegrees.
getLongitude() → double?
Gets the longitude value in decimal degrees.
getLongitudeE6() → int
Gets the longitude value in microdegrees.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
Calculate the spherical distance from this LatLong to another.
override

Operators

operator ==(Object other) → bool
Calculate the Euclidean distance from this LatLong to another.
override

Static Methods

fromMicroDegrees(int latitudeE6, int longitudeE6) → LatLong
Creates a LatLong from microdegree coordinates.
fromString(String latLonString) → LatLong
Parses a LatLong from a string with latitude and longitude values.