Auto-update of your location

In some applications, manual updating of location may not be desirable, for example, if your application is expected to update the location periodically to show the path in which a vehicle is moving. In this recipe, we will see how to configure the Ext.util.GeoLocation class to have the location automatically updated and how to control the frequency with which the location update should be attempted.

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. Set the following properties on the Ext.util.GeoLocation class while instantiating:
    autoUpdate: true,
    timeout: 5000,  //5 sec
  2. Deploy and access it from the device ...

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.