GPSDetector-Plugin for android.
$ cordova plugin add https://github.com/keshav-iitr/GPSDetector-Plugin.git
$ cordova prepare
document.addEventListener('deviceready', function() {
if (!window.GPSDetector) return;
window.GPSDetector(onGPSSuccess, onGPSError);
function onGPSSuccess(enabled) {
alert(enabled ? 'GPS is ON' : 'GPS is OFF');
console.log(enabled ? 'GPS is ON' : 'GPS is OFF');
}
function onGPSError(e) {
alert('GPSDetector is busted: ' + e);
console.log('GPSDetector is busted: ' + e);
}
}, false);