nativescript-geolocation
nativescript-geolocation copied to clipboard
UI: current location using geolocation
Hi, I am using geolocation plugin in NS-core to get the current location. Here is the code
var location = geolocation.getCurrentLocation({desiredAccuracy: 3, updateDistance: 10, maximumAge: 20000, timeout: 20000}). then(function(loc) { if (loc) { console.log("Current location is: " + JSON.stringify(loc)); } }, function(e){ console.log("Error: " + e.message); });
the code is giving the values of latitude, longitude, altitude, horizontalAccuracy, verticalAccuracy, direction, timestamp, android ..
My question is to which function I have to feed those values to get the current location(string) ??
Hi @sagar1911 ,
What kind of string do you expect? Could you give an example?
Best regards, Veselina
Hi @radeva, Location like Hyderabad .. Can I get like that ??
Hi @sagar1911 ,
Currently the plugin doesn't offer such functionality. To achieve this you need to use GeoCoder for Android and CLGeocoder for iOS (5+). We might consider implementing this in the future, but I cannot promise anything.
Till then, feel free to submit a PR with this feature.
Best regards, Veselina
Hello! Do you have some update about geocoder abstraction in NS?