Calculating distances between two points

In this chapter, we've already leaned how to find out our current location and how to pinpoint it on Google Maps. A step further could be to calculate the distance between two points. For getting these points, we can use the two different points through the current location. This means that we'll need to change the physical location of our iPhone.

For this recipe, we're going to develop a simple application, which captures two points and displays the distance between them. Although this recipe is very simple, you can extend its functionality by adjusting it to your requirements. For example, you can write an application that receives two points from a widget. In this case, the user can type the data for ...

Get iPhone JavaScript Cookbook now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.