Difference between revisions of "Geolocation"
Line 22: | Line 22: | ||
geolocation:start()</source> | geolocation:start()</source> | ||
{|- | {|- | ||
− | | style="width: 50%;"| | + | | style="width: 50%; vertical-align:top;"| |
=== Methods === | === Methods === | ||
− | [[Geolocation.getAccuracy]] | + | [[Geolocation.getAccuracy]] ''<translate>Geolocation - returns the previously set desired accuracy</translate>''<br/> |
− | [[Geolocation.getThreshold]] | + | [[Geolocation.getThreshold]] ''<translate>Geolocation - returns the previously set minimum distance threshold</translate>''<br/> |
− | [[Geolocation.isAvailable]] | + | [[Geolocation.isAvailable]] ''<translate>Geolocation - does this device have the capability to determine current location?</translate>''<br/> |
− | [[Geolocation.isHeadingAvailable]] | + | [[Geolocation.isHeadingAvailable]] ''<translate>Geolocation - does this device have the capability to determine heading?</translate>''<br/> |
− | [[Geolocation.new]] | + | [[Geolocation.new]] ''<translate>Creates new Geolocation instance</translate>''<br/> |
− | [[Geolocation.setAccuracy]] | + | [[Geolocation.setAccuracy]] ''<translate>of the location data</translate>''<br/> |
− | [[Geolocation.setThreshold]] | + | [[Geolocation.setThreshold]] ''<translate>threshold</translate>''<br/> |
− | [[Geolocation:start]] | + | [[Geolocation:start]] ''<translate>Geolocation - starts the generation of updates that report the current location and heading</translate>''<br/> |
− | [[Geolocation:startUpdatingHeading]] | + | [[Geolocation:startUpdatingHeading]] ''<translate>Geolocation - starts the generation of updates that report the heading</translate>''<br/> |
− | [[Geolocation:startUpdatingLocation]] | + | [[Geolocation:startUpdatingLocation]] ''<translate>Geolocation - starts the generation of updates that report the current location</translate>''<br/> |
− | [[Geolocation:stop]] | + | [[Geolocation:stop]] ''<translate>Geolocation - stops the generation of updates that report the current location and heading</translate>''<br/> |
− | [[Geolocation:stopUpdatingHeading]] | + | [[Geolocation:stopUpdatingHeading]] ''<translate>Geolocation - stops the generation of updates that report the heading</translate>''<br/> |
− | [[Geolocation:stopUpdatingLocation]] | + | [[Geolocation:stopUpdatingLocation]] ''<translate>Geolocation - stops the generation of updates that report the current location</translate>''<br/> |
− | | style="width: 50%;"| | + | | style="width: 50%; vertical-align:top;"| |
=== Events === | === Events === | ||
[[Event.ERROR]]<br/> | [[Event.ERROR]]<br/> |
Revision as of 14:33, 23 August 2018
Supported platforms: android, ios
Available since: Gideros 2012.8
Description
The Geolocation class is used to configure the parameters and dispatching of location and heading related events.
Examples
Example
geolocation = Geolocation.new()
local function onLocationUpdate(event)
print("location: ", event.latitude, event.longitude, event.altitude)
end
local function onHeadingUpdate(event)
print("heading: ", event.magneticHeading, event.trueHeading)
end
geolocation:addEventListener(Event.LOCATION_UPDATE, onLocationUpdate)
geolocation:addEventListener(Event.HEADING_UPDATE, onHeadingUpdate)
geolocation:start()
MethodsGeolocation.getAccuracy Geolocation - returns the previously set desired accuracy |
EventsEvent.ERROR Constants |