nativescript-geolocation icon indicating copy to clipboard operation
nativescript-geolocation copied to clipboard

UI: current location using geolocation

Open sagar1911 opened this issue 7 years ago • 4 comments

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) ??

sagar1911 avatar Aug 18 '17 06:08 sagar1911

Hi @sagar1911 ,

What kind of string do you expect? Could you give an example?

Best regards, Veselina

radeva avatar Aug 18 '17 07:08 radeva

Hi @radeva, Location like Hyderabad .. Can I get like that ??

sagar1911 avatar Aug 18 '17 07:08 sagar1911

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

radeva avatar Aug 18 '17 16:08 radeva

Hello! Do you have some update about geocoder abstraction in NS?

dnlmelo avatar Aug 10 '22 15:08 dnlmelo