Adding geolocation via GPS

Now that we have an even better working map view, let's go ahead and add some basic navigation features to it, namely, the ability to focus the map on our current physical location.

First, let's add a button to the footer toolbar for now. Make sure that the ion-footer-bar tag looks like the following:

<ion-footer-bar class="bar-stable">
  <a ng-click="centerOnUser()" class="button button-icon icon ion-navigate"></a>
</ion-footer-bar>

Your preview should now look like this:

Adding geolocation via GPS

Now, we need to hook into the location capabilities of the native device in order to find the user's current location. Fortunately, this can be done directly ...

Get Learning Node.js for Mobile Application Development 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.