how capturing geolocation with device offline - cordova

To check if the GPS is available or not you can use this diagnostic plugin - it works for Android and iOS. It can also be used to display the native location settings screen to allow the user to enable location services. For example:

cordova.plugins.diagnostic.isLocationEnabled(function(enabled){
    console.log("GPS is "+(enabled ? "enabled" : "disabled");
    if(!enabled){
        cordova.plugins.diagnostic.switchToLocationSettings();
    }
},function(error){
    console.error("An error occurred: "+ error);
});

As the other answer already states, you can receive a user's location using GPS without needing an internet connection using the geolocation API, but if you want to display a map you'll need a custom solution that doesn't rely on online maps such as Google.

If you want to record the user's location while offline, you can store this information offline in local persistent storage and upload it when the user has an internet connection again. You could use something like lawnchair for the storage.


I´ll try to answer you:

1.- There you have the way to use PhoneGap GeoLication API to check location, and if GPS is enabled. Check this too: Use PhoneGap to Check if GPS is enabled

2.- Yes, the GPS is a satellite system that allows your device to track it´s current position on earth. It´s independent from your Cellphone operator, and then, from the Internet Connection. Then, your device will be able to know it´s position. HTML5 offline mode and geolocation

In addition, you´ll probably need Internet connection to show a map. There are not much solutions for offline maps. Just artisan ones: http://davidrs.com/wp/phonegap-3-0-leaflet-offline-maps/

Hope it helps

REMEMBER: When turning on plane mode, most of devices will turn off GPS antenna too.