If you can't see the GPS logo in the Status-bar, it's because GPS doesn't start. Maybe one JS-file is not loaded ?
Cordova/phonegap is not native code, there are only three options you could put on watchPosition() function : maximumAge, timeout and enableHighAccuracy (to use GPS). You can just set enableHighAccuracy at true to use GPSProvider and not NetworkBaseProvider.
Maybe you can analyse the error message in onError function to look at if a special message is sent when GPS is disabled.
Edit : In my test, no special message appaers, just a timeout message : "Position retrieval timed out." So I think you can't check if GPS is on or off in cordova...
In my opinion, Cordova/phonegap (and all the "crossplatforms" technologies) is not a good choice to develop an app using GPS and others managers like TelephonyManager.
Nothing can replace native code for that.
I have an other problem : GPS dont stop when I use clearWatch():
Here, my code :
var currentTracking = false;
var idwatch = null;
function switchTracking() {
//when button is pressed to start GPS
if (!currentTracking) {
currentTracking = true;
document.getElementById('switchTracking').value = "Stop GPS"
tracking();
}
//when button is pressed to stop GPS
else {
navigator.geolocation.clearWatch(idwatch);
currentTracking = false;
document.getElementById('switchTracking').value = "Start GPS"
}
}
function tracking() {
if (currentTracking) {
idwatch = navigator.geolocation.watchPosition(onSuccess, onError,{ timeout: 5000, enableHighAccuracy: true });
}
else{
navigator.geolocation.clearWatch(idwatch);
}
}
function onSuccess(position) {
// alert("Gps");
var lat = document.getElementById('lat');
var long = document.getElementById('long');
lat.innerHTML = position.coords.latitude;
long.innerHTML = position.coords.longitude;
}
// onError Callback receives a PositionError object
//
function onError(error) {
alert('code: ' + error.code + '\n' +
'message: ' + error.message + '\n');
}