OSRef class

Constructors

OSRef(int easting, int northing)
Creates a new OSRef object with a given easting and northing (e.g. 651409, 313177)
OSRef.fromJson(Map<String, dynamic> json)
Creates a new OSRef object from a given JSON object
OSRef.fromLetterRef(String letterRef)
Creates a new OSRef object with a given letter reference (e.g. TG 51409 13177)

Properties

d Map<String, Object>
The datum that the reference will output it's lat and long coordinates in. By default it is the WGS84 datum but this can be overriden when calling the toLatLon() function
getter/setter pair
easting int
The easting value of the reference
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
letterRef String
The full letter reference. This can be specified upon creation or generated if the object is created using a separate easting and northing.
getter/setter pair
northing int
The northing value of the reference
getter/setter pair
numericalRef String
The full numerical reference. This is the easting and northing separated by a space
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getEastingNorthing(String gridRef) → dynamic
Returns the easting and northing of a given letter pair reference For example, a letter pair reference of TG 51409 13177 will return an easting of 651409 and a northing of 313177
getLetterRef(int e, int n, [int digits = 10]) String
Returns the letter pair reference of a given easting and northing For example, a reference with an easting of 651409 and a northing of 313177 equates to a letter pair reference of TG 51409 13177 The default amount of digits is 10
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts the OSRef into a JSON object
toLatLon([dynamic datum]) LatLong
Converts the OSRef object (easting and northing given when object is created) into a latitude and longitude of a specified datum Most widely used datum in Europe is WGS84 (this is what is used by phone GPS)
toString() String
A string representation of this object.
inherited

Operators

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