new Location(weather, latitude, longitude)
Location API
Parameters:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
weather |
object | Weather object. | ||
latitude |
number |
<optional> |
current location latitude | Latitude of location, from where weather data will be acquired. |
longitude |
number |
<optional> |
current location longitude | Longitude of location, from where weather data will be acquired. |
- Source:
Members
-
city
-
Name of the city of current location
- Source:
-
timeOfLastLocation
-
Time when location was updated.
- Source:
-
weather
-
Weather object
- Source:
Methods
-
acquireLocation()
-
Starts getting current location
- Source:
-
acquireLocationIP()
-
Acquires location from device ip address
- Source:
-
getLocationName()
-
Gets name of acquired location based on geolocation with reverse-geocoding API
- Source:
-
isNewUpdateRequired() → {boolean}
-
Returns true if distance between old and new location is more than 1000 meters or else
- Source:
Returns:
- Type
- boolean
-
setLocation()
-
Sets latitude and longitude from received data.
- Source:
-
updateLocation()
-
Method called from 10 seconds timer
- Source: