Chapter 9. Location, Location, Location

In this chapter, we will cover:

  • Detecting current orientation
  • Identifying the current location
  • Opening Google Maps at a specific location
  • Calculating distances between two points

Introduction

This chapter introduces you to the world of geolocation and how to take advantage of it using our mobile devices. Basically, geolocation is a term used for defining the action of getting an exact location using the latitude and longitude coordinates. HTML5 and some of our frameworks offer us functionalities and features for utilizing geolocation. Thanks to it, we can add these seemingly complex features to our web applications for iOS devices.

Google Maps is one of the most popular available web services and many people consider it as a de facto standard for different issues related to geolocation on the Web. One of our recipes for this chapter uses the services provided by Google Maps for displaying a map and adding a map marker at a specific location.

Native applications for the iPhone are able to access the functionalities and features of the internal GPS receptor of the device directly. However, this is not possible for web applications. Luckily, some of these features can be replaced for those provided by HTML5. Also, some frameworks, such as PhoneGap and Sencha Touch, offer these native functionalities.

As you know, iPhone includes an accelerometer for detecting the orientation of the device. This feature is simple in concept but it can be a very powerful enhancement for certain applications. You will find that the first recipe in this chapter is related to the accelerometer.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.136.84