How to capture geolocation with a device offline - cordova

I am developing an application using a cord, and I have discovered the need to receive data on the latitude and longitude of the User, but my application will be used offline (without Internet access).

I have two questions:

1 - How to check if the GPS device is active or not?

2 - How can I get latitude and longitude offline without an internet connection? Is it possible?

+4
source share
2 answers

I will try to answer you:

1.- PhoneGap GeoLication API, GPS. : PhoneGap GPS

2.- , GPS - , . , -. . HTML5

, , , , . . : http://davidrs.com/wp/phonegap-3-0-leaflet-offline-maps/

,

. GPS.

+3

, GPS, - Android iOS. , . :

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

, GPS API , , , Google.

, , . - lawnchair .

0

All Articles