You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.
Please, tell us how to recreate the issue in as much detail as possible.
I'm using Google Maps SDK and Geolocation, so when mapReady event is triggered, I call a method named startTracking which enable and checks for location permissions, and then calls a method named watchLocation, which will use watchLocation method from nativescript-geolocation. watchLocation does return the watch ID, but it hangs, nothing happens, it does not enter in success callback nor in error callback. I tried before with getCurrentLocation using async/await and the same thing happens, nothing happens and it does not execute the code after this method call.
Is there any code involved?
mapReady:
asyncmapReady(args){try{// Get map viewthis.mapView=args.object// Set map settingsthis.mapView.settings.mapToolbarEnabled=falsethis.mapView.setStyle([{featureType: 'poi',stylers: [{visibility: 'off'}]}])// Start trackingawaitthis.startTracking()}catch(ex){console.log(ex)alert(ErrorFormatter(ex))}},
startTracking:
asyncstartTracking(){try{// Ask for location permissionawaitgeolocation.enableLocationRequest(true,true)// Check if location is enabledconstisEnabled=awaitgeolocation.isEnabled()// If location is enabledif(isEnabled){// Start location watchthis.watchLocation()}}catch(ex){console.log(ex)alert(ErrorFormatter(ex))}},
Hi @DeehSlash, the timeout error you have comes from the getCurrentLocation() API of the plugin rather than watchLocation(). So, could this timeout be unrelated to the code (using watchLocation()) you have pasted in your initial post?
Having the provided info, to me it looks that a hang in your app could be caused by some code like:
await geolocation.watchLocation(...)
Such a call would hang the app either until the location is acquired, or until the timeout is reached. Refer to the code in Android implementation. So, if you use it this way, maybe you should reconsider that.
If that is not your case, a sample app reproducing the issue would be best to be able to assist you further.
Which platform(s) does your issue occur on?
Please, provide the following version numbers that your issue occurs with:
Please, tell us how to recreate the issue in as much detail as possible.
I'm using Google Maps SDK and Geolocation, so when mapReady event is triggered, I call a method named
startTracking
which enable and checks for location permissions, and then calls a method namedwatchLocation
, which will usewatchLocation
method fromnativescript-geolocation
.watchLocation
does return the watch ID, but it hangs, nothing happens, it does not enter in success callback nor in error callback. I tried before with getCurrentLocation using async/await and the same thing happens, nothing happens and it does not execute the code after this method call.Is there any code involved?
mapReady:
startTracking:
watchLocation:
The text was updated successfully, but these errors were encountered: