I program an app where I need GPS.
If the GPS is off, how can I ask the user to turn on GPS, like google maps? After a while of googleing I found nothing compareable...
My other question is, why I get "Use location? - 2", when the GPS is off? I thought, if the GPS is off, $window.navigator.geolocation is false?

[![Google Maps](https://i.stack.imgur.com/2m6wd.png)](https://i.stack.imgur.com/2m6wd.png)

controller.js

```
if ($window.navigator && $window.navigator.geolocation) { 
    function success(pos) {
        $rootScope.position = { x: pos.coords.latitude, y: pos.coords.longitude };
    }
    function fail(error) {
        alert("Use location? - 2");
    }
     $window.navigator.geolocation.getCurrentPosition(success, fail, { maximumAge: 500000, enableHighAccuracy: true, timeout: 6000 });
} else {
    alert("Use location? - 1");
}

```