Cordova Angularjs ask for GPS -


i program app need gps. if gps off, how can ask user turn on gps, google maps? after while of googleing found nothing compareable... other question is, why "use location? - 2", when gps off? thought, if gps off, $window.navigator.geolocation false?

google maps

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"); } 

there many plugins promess if gps enable. can ask user change location settings. 1 of them diagnostics plugin https://www.npmjs.com/package/cordova.plugins.diagnostic . using it. (al least call location settings).


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -