import Geolocation from 'skygear-build/packages/skygear-core/lib/geolocation.js'Geolocation
Geolocation
A model representing a latlong location in Skygear record.
Static Method Summary
| Static Public Methods | ||
| public static |
fromJSON(attrs: Object): * Constructs a new Geolocation object from JSON object. |
|
Constructor Summary
| Public Constructor | ||
| public |
constructor(latitude: Number, longitude: Number) Constructs a new Geolocation object. |
|
Method Summary
| Public Methods | ||
| public |
toJSON(): Object Serializes Geolocation to a JSON object. |
|
Static Public Methods
public static fromJSON(attrs: Object): * source
Constructs a new Geolocation object from JSON object.
Params:
| Name | Type | Attribute | Description |
| attrs | Object | the JSON object |
|
| attrs.$latitude | Number | latitude of the location |
|
| attrs.$longitude | Number | longitude of the location |
Return:
| * |
Public Constructors
public constructor(latitude: Number, longitude: Number) source
Constructs a new Geolocation object.
Params:
| Name | Type | Attribute | Description |
| latitude | Number | latitude of the location |
|
| longitude | Number | longitude of the location |
Public Methods
public toJSON(): Object source
Serializes Geolocation to a JSON object.
Return:
| Object | the JSON object |
