Getting the device's location
In order to search photos that were taken around the device's location, it is imperative that we determine where this location is. Titanium provides us with a Geolocation module that is provided with the SDK.
The module provides the following two main families of features:
Location services that can be used to determine the location of the device.
Geocoding and reverse geocoding that can be used to convert geographic coordinates into street addresses. The reverse is also possible, meaning that we can convert physical addresses into geographic coordinates.
Tip
Be always thoughtful of power consumption when dealing with location services. Many factors such as accuracy and update frequency can have a huge impact on the device's battery life, if it is not used properly.
How does that translate into code?
Inside our ApplicationWindow
function, after defining the user interface, we will add our Geolocation code.
On iOS specifically, the user must approve the use of the location...