Skip to content Skip to sidebar Skip to footer

Apache Cordova Geolocation Not Providing Data

I'm using Apache Cordova to get the lat and long coordinates of a device to pass on to a parse database. However, the coordinates are returning blank and no error alert appears. JS

Solution 1:

It seems you made this inverted:

Change:

position.coords.longitude=long1;position.coords.latitude=lat1;

To:

long1 = position.coords.longitude;lat1 = position.coords.latitude;

Solution 2:

I had the same problem. I fixed it by explicitly installing the plugin: cordova plugin add cordova-plugin-geolocation

However, I'm using $cordovaGeolocation.getCurrentPosition, not navigator.geolocation.getCurrentPosition.

Hope this help you! :)

Post a Comment for "Apache Cordova Geolocation Not Providing Data"