GeoPoint class

Represents a geographical point on Earth using latitude and longitude.

The GeoPoint class is immutable and represents a specific location using the WGS 84 coordinate system (used by GPS).

Example:

final point = GeoPoint(
  latitude: 37.7749,
  longitude: -122.4194,
);

Constraints:

  • Latitude must be between -90 and 90 degrees
  • Longitude must be between -180 and 180 degrees
Available extensions

Constructors

GeoPoint({required double latitude, required double longitude})
Creates a new GeoPoint with the given latitude and longitude.
const
GeoPoint.fromMap(Map<String, double> map)
Creates a GeoPoint from a map containing 'latitude' and 'longitude' keys.
factory

Properties

hashCode int
Returns a hash code for this GeoPoint.
no setteroverride
latitude double
Latitude in decimal degrees.
final
longitude double
Longitude in decimal degrees.
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
toFlutterLatLng() → LatLng

Available on GeoPoint, provided by the GeoPointExtensions extension

Converts this GeoPoint to a LatLng for use with flutter_map.
toGoogleLatLng() → LatLng

Available on GeoPoint, provided by the GeoPointExtensions extension

Converts this GeoPoint to a google.LatLng for use with google_maps_flutter.
toMap() Map<String, double>
Converts this GeoPoint to a map.
toString() String
Returns a string representation of this point.
override

Operators

operator ==(Object other) bool
Compares this GeoPoint with other for equality.
override