LatLng class
Represents a geographical location using latitude and longitude coordinates.
This class extends PointX
to provide additional functionalities specific
to geographical coordinates, including methods to work with different
coordinate formats and geospatial calculations.
Constructors
- LatLng.new(double lat, double lng, [double? elevation])
- Creates a LatLng instance with specified latitude, longitude, and optional elevation.
-
LatLng.fromList(List<
double> list) - Creates a LatLng instance from a List containing latitude, longitude, and optional elevation.
- LatLng.fromMap(Map map)
- Creates a LatLng instance from a Map containing latitude, longitude, and optional elevation.
- LatLng.fromSexagesimal(String sexagesimal)
-
Converts sexagesimal string into a lat/long value
factory
- LatLng.fromString(String latLngAsString)
- Creates a LatLng instance from a string representation of coordinates (e.g.: "40.7128,-74.0060").
Properties
- country ↔ String?
-
getter/setter pairinherited
- crs ↔ Projection?
-
getter/setter pairinherited
- crsCode ↔ String?
-
getter/setter pairinherited
- desc ↔ String?
-
A text description of the element. Holds additional information about the
element intended for the user.
getter/setter pairinherited
- elevation → double?
-
The elevation (in meters) of the point.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- lat → double
-
The longitude of the point. This is always in decimal degrees
final
- latitude → Angle
-
Latitude, Y Axis.
no setteroverride
- lng → double
-
The longitude of the point. This is always in decimal degrees.
final
- longitude → Angle
-
Longitude, X Axis.
no setteroverride
- m ↔ double?
-
getter/setter pairinherited
- name ↔ String?
-
The name of the point. This field will be transferred to and from
the conversion.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selected ↔ bool
-
getter/setter pairinherited
- status ↔ String?
-
getter/setter pairinherited
- type ↔ CoordinateType?
-
getter/setter pairinherited
- x ↔ double
-
getter/setter pairinherited
- y ↔ double
-
getter/setter pairinherited
- z ↔ double?
-
getter/setter pairinherited
Methods
-
alongTrackDistanceTo(
LatLng point1, LatLng point2) → Length - Calculates the along-track distance to the closest point on the great-circle path between two points.
-
asLatLng(
) → LatLng -
Converts the PointX instance to a LatLng object.
inherited
-
copyWith(
{double? x, double? y, double? z, double? m, String? name, CoordinateType? type, String? status, String? desc, String? country, String? crsCode, Projection? crs}) → PointX -
Copies the current PointX instance and overrides it with given values.
inherited
-
crossTrackDistanceTo(
LatLng point1, LatLng point2) → Length - Calculates the cross-track distance to the great-circle path between two points.
-
destinationPoint(
double distance, double bearing) → LatLng - Calculates the destination point given a distance and bearing from this point.
-
distanceTo(
LatLng point, {DistanceMethod method = DistanceMethod.haversine}) → Length? - Calculates the distance to another point using a specified method.
-
finalBearingTo(
LatLng point) → Bearing - Calculates the final bearing from this point to another point.
-
getValue(
PointXPart part) → dynamic -
Gets the value of a specified part of the PointX instance.
inherited
-
initialBearingTo(
LatLng point) → Bearing - Calculates the initial bearing from this point to another point.
-
midPointTo(
LatLng point) → LatLng - Calculates the midpoint between this point and another point.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
rhumbDestinationPoint(
double distance, double bearing) → LatLng - Calculates the destination point using rhumb line navigation given a distance and bearing from this point.
-
rhumbLineBearing(
LatLng point) → Bearing - Calculates the rhumb line bearing to another point.
-
rhumbLineDistance(
LatLng point) → Length - Calculates the rhumb line distance to another point.
-
rhumbMidpoint(
LatLng point) → LatLng - Calculates the midpoint along a rhumb line between this point and another point.
-
setValue(
PointXPart part, String newValue) → dynamic -
Sets the value of a specified part of the PointX instance.
inherited
-
toArray(
) → List< double> -
inherited
-
toDataArray(
) → List -
Converts the PointX instance into a data array.
inherited
-
toMGRS(
[int accuracy = 5]) → String - Convert lat/lon to MGRS.
-
toPoint(
) → Point -
Converts the PointX instance to a Point object.
inherited
-
toSexagesimal(
{int decPlaces = 3}) → String - final LatLng p1 = new LatLng(51.519475, -19.37555556);
-
toString(
) → String -
Returns a string representation of the PointX instance.
override
-
toTimeZone(
) → List< num> - Convert LatLong to timezone
-
toUTM(
) → UTM - Return the Latitude and Longitude to UTM coordinates
-
toWPT(
) → Wpt - Converts the LatLng instance to a Wpt (Waypoint) object.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override