Start a new topic

How to restart Location in Wikitude

wikitudePlugin.setLocation 


Use this function to inject a location into the Wikitude SDK~~, Location update will stop.


How to restart Location or unsetLocation ?





When I am indoors, I can use beacon and setLocation to achieve positioning effect.

 

But when I go outdoors, I want to use GPS to locate

 

So I hope to switch it


thanks

Hi,



I just had a chat with one of our Android developers. He explained that, on Android at least, you need to provide the location by calling `setLocation` for regular Geo AR to work in the first place. So, it seems what you need is not negate the effect of your `setLocation` call, but simply to go back to updating the location in the manner is was done previously.


If you have a look at out samples, you'll notice that they subscribe to an `onLocationChanged` event, calling `setLocation` continuously.



- Daniel

- Which version of the SDK are you using? ---> 8.3.0

- Are you using any of our Extensions (Cordova, Xamarin, Unity)? ---> Cordova

 

- what device ---> Android

- is this happening with the sample app or in your own app? --> MY app

If it happens with your own app, does the sample app work on your device. --> YES

 

- exact details on which location you wish to reset - are you referrring to location updates?

不好意思, 我能否用中文表達?

當我使用 app.wikitudePlugin.setLocation 後, 它就會到我指定的位置是沒問題的.

那我要怎麼讓它重新啟用GPS定位?


Hi,


Please provide further details on the following:


- Which version of the SDK are you using?
- Are you using any of our Extensions (Cordova, Xamarin, Unity)? From the category it looks like Cordova, please confirm

- what device does this happen with
- is this happening with the sample app or in your own app? If it happens with your own app, does the sample app work on your device.
- exact details on which location you wish to reset - are you referrring to location updates?


Thx and greetings

Nicola

Hi Lucien,



that's a very good question. I don't think we have an API to "unset" the injected location and return to the automatic location updates. You will have to provide the updates yourself as soon as you call `setLocation`.


May I ask what your exact use case is, injecting a location and then unsetting it again seems like a very peculiar scenario to me. Maybe there's another way of achieving what you're trying to do.



- Daniel

Login or Signup to post a comment