Our map may be working, but it is currently hardcoded to appear above London, England, and not all of us live and work in that big city. One of the great things about mapping technology is that we can determine our location from anywhere in the world via GPS satellites, Wi-Fi networks, and cellphone towers. This allows you to put maps into context, and lets you issue data to your user that is targeted to their physical location.
In order to get our current location, we need to use the
Ti.Geolocation namespace, which contains a method called
getCurrentPosition. The next recipe will explain how to use this namespace to adjust the bounds of the
MapView to your current location.
The complete source code ...