Mapping Geolocation on Google Maps

So far in this chapter, we have looked at the Ext.util.GeoLocation and Ext.util.Map classes of Sencha Touch to see how to get the location and how to display a map. In this recipe, we will put these two pieces together, so that the location information from the GeoLocation class can be used on the Map class in rendering the information on the map. This can then be used, for example, to highlight the nearest restaurants on the map, based on the current location.

Getting ready

Make sure that you have set up your development environment by following the recipes outlined in Chapter 1.

How to do it...

Carry out the following steps:

  1. Create and open a new file named ch10_03.js and paste the following code into it:
    Ext.setup({ ...

Get Sencha Touch Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.