Difference between revisions of "Geolocation"
Line 4: | Line 4: | ||
=== Description === | === Description === | ||
<translate><br /> | <translate><br /> | ||
− | The [[Geolocation]] class is used to configure the parameters and dispatching of location and heading related events.<br /> | + | The [[Special:MyLanguage/Geolocation|Geolocation]] class is used to configure the parameters and dispatching of location and heading related events.<br /> |
<br /></translate> | <br /></translate> | ||
=== Examples === | === Examples === | ||
Line 24: | Line 24: | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
=== Methods === | === Methods === | ||
− | [[Geolocation.getAccuracy]] ''<translate>Geolocation - returns the previously set desired accuracy</translate>''<br/> | + | [[Special:MyLanguage/Geolocation.getAccuracy|Geolocation.getAccuracy]] ''<translate>Geolocation - returns the previously set desired accuracy</translate>''<br/> |
− | [[Geolocation.getThreshold]] ''<translate>Geolocation - returns the previously set minimum distance threshold</translate>''<br/> | + | [[Special:MyLanguage/Geolocation.getThreshold|Geolocation.getThreshold]] ''<translate>Geolocation - returns the previously set minimum distance threshold</translate>''<br/> |
− | [[Geolocation.isAvailable]] ''<translate>Geolocation - does this device have the capability to determine current location?</translate>''<br/> | + | [[Special:MyLanguage/Geolocation.isAvailable|Geolocation.isAvailable]] ''<translate>Geolocation - does this device have the capability to determine current location?</translate>''<br/> |
− | [[Geolocation.isHeadingAvailable]] ''<translate>Geolocation - does this device have the capability to determine heading?</translate>''<br/> | + | [[Special:MyLanguage/Geolocation.isHeadingAvailable|Geolocation.isHeadingAvailable]] ''<translate>Geolocation - does this device have the capability to determine heading?</translate>''<br/> |
− | [[Geolocation.new]] ''<translate>Creates new Geolocation instance</translate>''<br/> | + | [[Special:MyLanguage/Geolocation.new|Geolocation.new]] ''<translate>Creates new Geolocation instance</translate>''<br/> |
− | [[Geolocation.setAccuracy]] ''<translate>of the location data</translate>''<br/> | + | [[Special:MyLanguage/Geolocation.setAccuracy|Geolocation.setAccuracy]] ''<translate>of the location data</translate>''<br/> |
− | [[Geolocation.setThreshold]] ''<translate>threshold</translate>''<br/> | + | [[Special:MyLanguage/Geolocation.setThreshold|Geolocation.setThreshold]] ''<translate>threshold</translate>''<br/> |
− | [[Geolocation:start]] ''<translate>Geolocation - starts the generation of updates that report the current location and heading</translate>''<br/> | + | [[Special:MyLanguage/Geolocation:start|Geolocation:start]] ''<translate>Geolocation - starts the generation of updates that report the current location and heading</translate>''<br/> |
− | [[Geolocation:startUpdatingHeading]] ''<translate>Geolocation - starts the generation of updates that report the heading</translate>''<br/> | + | [[Special:MyLanguage/Geolocation:startUpdatingHeading|Geolocation:startUpdatingHeading]] ''<translate>Geolocation - starts the generation of updates that report the heading</translate>''<br/> |
− | [[Geolocation:startUpdatingLocation]] ''<translate>Geolocation - starts the generation of updates that report the current location</translate>''<br/> | + | [[Special:MyLanguage/Geolocation:startUpdatingLocation|Geolocation:startUpdatingLocation]] ''<translate>Geolocation - starts the generation of updates that report the current location</translate>''<br/> |
− | [[Geolocation:stop]] ''<translate>Geolocation - stops the generation of updates that report the current location and heading</translate>''<br/> | + | [[Special:MyLanguage/Geolocation:stop|Geolocation:stop]] ''<translate>Geolocation - stops the generation of updates that report the current location and heading</translate>''<br/> |
− | [[Geolocation:stopUpdatingHeading]] ''<translate>Geolocation - stops the generation of updates that report the heading</translate>''<br/> | + | [[Special:MyLanguage/Geolocation:stopUpdatingHeading|Geolocation:stopUpdatingHeading]] ''<translate>Geolocation - stops the generation of updates that report the heading</translate>''<br/> |
− | [[Geolocation:stopUpdatingLocation]] ''<translate>Geolocation - stops the generation of updates that report the current location</translate>''<br/> | + | [[Special:MyLanguage/Geolocation:stopUpdatingLocation|Geolocation:stopUpdatingLocation]] ''<translate>Geolocation - stops the generation of updates that report the current location</translate>''<br/> |
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
=== Events === | === Events === | ||
− | [[Event.ERROR]]<br/> | + | [[Special:MyLanguage/Event.ERROR|Event.ERROR]]<br/> |
− | [[Event.HEADING_UPDATE]]<br/> | + | [[Special:MyLanguage/Event.HEADING_UPDATE|Event.HEADING_UPDATE]]<br/> |
− | [[Event.LOCATION_UPDATE]]<br/> | + | [[Special:MyLanguage/Event.LOCATION_UPDATE|Event.LOCATION_UPDATE]]<br/> |
=== Constants === | === Constants === | ||
|} | |} |
Revision as of 16: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 |