Connect IQ > APIメモ > Toybox > Position > Location


Class: Toybox::Position::Location



The Location object represents a position. It provides accessor methods for retrieving the coordinates in various formats.

Since:

   1.0.0

Instance Method Summary
(collapse)

   - (Location) initialize(options) constructor

   Constructor: create a coordinate based off an options hash table.
   - (Array) toDegrees

   Use toDegrees() to retrieve the coordinate back as an Array of degree values.
   - (String) toGeoString(format)

   Use toGeoString() to get a String representation of the coordinate.
   - (Array) toRadians

   Use toRadians() to retrieve the coordinate back as an Array of radian values.

Constructor Details
  • (Location) initialize(options)

Constructor: create a coordinate based off an options hash table

Parameters:

   options (Dictionary) —

   Hash table of options

Options Hash (options):

   :latitude (Number) —

   The latitude
   :longitude (Number) —

   The longitude
   :format (Symbol) —

   The format of lat/long (possible values are :degrees, :radians, or :semicircles)

Since:

   1.0.0

Instance Method Details
  • (Array) toDegrees

Use toDegrees() to retrieve the coordinate back as an Array of degree values.

Returns:

   (Array) —

   An Array of the latitude and the longitude in degree format

Since:

   1.0.0

  • (String) toGeoString(format)

Use toGeoString() to get a String representation of the coordinate.

Parameters:

   format —

   Coordinate format to which coordinate should be converted (GEO constant)

Returns:

   (String) —

   Formatted coordinate String

Since:

   1.0.0

  • (Array) toRadians

Use toRadians() to retrieve the coordinate back as an Array of radian values.

Returns:

   (Array) —

   An Array of the latitude and the longitude in radian format

Since:

   1.0.0
最終更新:2016年03月03日 00:05