Difference between revisions of "Geolocation"
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
+ | <!-- GIDEROSOBJ:Geolocation --> | ||
'''<translate>Supported platforms</translate>:''' [[File:Platform android.png]][[File:Platform ios.png]]<br/> | '''<translate>Supported platforms</translate>:''' [[File:Platform android.png]][[File:Platform ios.png]]<br/> | ||
'''<translate>Available since</translate>:''' Gideros 2012.8<br/> | '''<translate>Available since</translate>:''' Gideros 2012.8<br/> | ||
Line 25: | Line 26: | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
=== <translate>Methods</translate> === | === <translate>Methods</translate> === | ||
− | [[Special:MyLanguage/Geolocation.getAccuracy|Geolocation.getAccuracy]] ''<translate> | + | [[Special:MyLanguage/Geolocation.getAccuracy|Geolocation.getAccuracy]] ''<translate>returns the previously set desired accuracy</translate>''<br/><!-- GIDEROSMTD:Geolocation.getAccuracy --> |
− | [[Special:MyLanguage/Geolocation.getThreshold|Geolocation.getThreshold]] ''<translate> | + | [[Special:MyLanguage/Geolocation.getThreshold|Geolocation.getThreshold]] ''<translate>returns the previously set minimum distance threshold</translate>''<br/><!-- GIDEROSMTD:Geolocation.getThreshold --> |
− | [[Special:MyLanguage/Geolocation.isAvailable|Geolocation.isAvailable]] ''<translate> | + | [[Special:MyLanguage/Geolocation.isAvailable|Geolocation.isAvailable]] ''<translate>does this device have the capability to determine current location?</translate>''<br/><!-- GIDEROSMTD:Geolocation.isAvailable --> |
− | [[Special:MyLanguage/Geolocation.isHeadingAvailable|Geolocation.isHeadingAvailable]] ''<translate> | + | [[Special:MyLanguage/Geolocation.isHeadingAvailable|Geolocation.isHeadingAvailable]] ''<translate>does this device have the capability to determine heading?</translate>''<br/><!-- GIDEROSMTD:Geolocation.isHeadingAvailable --> |
− | [[Special:MyLanguage/Geolocation.new|Geolocation.new]] ''<translate>Creates new Geolocation instance</translate>''<br/> | + | [[Special:MyLanguage/Geolocation.new|Geolocation.new]] ''<translate>Creates new Geolocation instance</translate>''<br/><!-- GIDEROSMTD:Geolocation.new --> |
− | [[Special:MyLanguage/Geolocation.setAccuracy|Geolocation.setAccuracy]] ''<translate>of the location data</translate>''<br/> | + | [[Special:MyLanguage/Geolocation.setAccuracy|Geolocation.setAccuracy]] ''<translate>of the location data</translate>''<br/><!-- GIDEROSMTD:Geolocation.setAccuracy --> |
− | [[Special:MyLanguage/Geolocation.setThreshold|Geolocation.setThreshold]] ''<translate>threshold</translate>''<br/> | + | [[Special:MyLanguage/Geolocation.setThreshold|Geolocation.setThreshold]] ''<translate>threshold</translate>''<br/><!-- GIDEROSMTD:Geolocation.setThreshold --> |
− | [[Special:MyLanguage/Geolocation:start|Geolocation:start]] ''<translate> | + | [[Special:MyLanguage/Geolocation:start|Geolocation:start]] ''<translate>starts the generation of updates that report the current location and heading</translate>''<br/><!-- GIDEROSMTD:Geolocation:start --> |
− | [[Special:MyLanguage/Geolocation:startUpdatingHeading|Geolocation:startUpdatingHeading]] ''<translate> | + | [[Special:MyLanguage/Geolocation:startUpdatingHeading|Geolocation:startUpdatingHeading]] ''<translate>starts the generation of updates that report the heading</translate>''<br/><!-- GIDEROSMTD:Geolocation:startUpdatingHeading --> |
− | [[Special:MyLanguage/Geolocation:startUpdatingLocation|Geolocation:startUpdatingLocation]] ''<translate> | + | [[Special:MyLanguage/Geolocation:startUpdatingLocation|Geolocation:startUpdatingLocation]] ''<translate>starts the generation of updates that report the current location</translate>''<br/><!-- GIDEROSMTD:Geolocation:startUpdatingLocation --> |
− | [[Special:MyLanguage/Geolocation:stop|Geolocation:stop]] ''<translate> | + | [[Special:MyLanguage/Geolocation:stop|Geolocation:stop]] ''<translate>stops the generation of updates that report the current location and heading</translate>''<br/><!-- GIDEROSMTD:Geolocation:stop --> |
− | [[Special:MyLanguage/Geolocation:stopUpdatingHeading|Geolocation:stopUpdatingHeading]] ''<translate> | + | [[Special:MyLanguage/Geolocation:stopUpdatingHeading|Geolocation:stopUpdatingHeading]] ''<translate>stops the generation of updates that report the heading</translate>''<br/><!-- GIDEROSMTD:Geolocation:stopUpdatingHeading --> |
− | [[Special:MyLanguage/Geolocation:stopUpdatingLocation|Geolocation:stopUpdatingLocation]] ''<translate> | + | [[Special:MyLanguage/Geolocation:stopUpdatingLocation|Geolocation:stopUpdatingLocation]] ''<translate>stops the generation of updates that report the current location</translate>''<br/><!-- GIDEROSMTD:Geolocation:stopUpdatingLocation --> |
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
=== <translate>Events</translate> === | === <translate>Events</translate> === | ||
− | [[Special:MyLanguage/Event.ERROR|Event.ERROR]]<br/> | + | [[Special:MyLanguage/Event.ERROR|Event.ERROR]]<br/><!-- GIDEROSEVT:Event.ERROR --> |
− | [[Special:MyLanguage/Event.HEADING_UPDATE|Event.HEADING_UPDATE]]<br/> | + | [[Special:MyLanguage/Event.HEADING_UPDATE|Event.HEADING_UPDATE]]<br/><!-- GIDEROSEVT:Event.HEADING_UPDATE --> |
− | [[Special:MyLanguage/Event.LOCATION_UPDATE|Event.LOCATION_UPDATE]]<br/> | + | [[Special:MyLanguage/Event.LOCATION_UPDATE|Event.LOCATION_UPDATE]]<br/><!-- GIDEROSEVT:Event.LOCATION_UPDATE --> |
=== <translate>Constants</translate> === | === <translate>Constants</translate> === | ||
|} | |} |
Revision as of 14:54, 31 August 2018
Supported platforms:
Available since: Gideros 2012.8
Inherits from: Object
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 returns the previously set desired accuracy |
EventsEvent.ERROR Constants |