Start a new topic

setLocation from flutter

I am trying to adjust one of the provided samples so it uses the device's gps location. To achieve that, I have implemented a third party plugin, which is providing the necessary arguments. Yet I do not know how to exactly call the setLocation-method from within the flutter app.


I have not found a thread tackling that problem, if you have one in mind I am happy to have a look since I am sure that I am not the first to have an issue with this.


Thanks in advance!


Hello Nicola,


I thought I had solved the whole issue. However, I am still confused because, eventhough I am providing the location with the plugin mentioned above, the locationChanged-method of the SDK is being called multiple times with unrealistic values for altitude and accuracy. Furthermore, the locationChanged-method is called many times more than I am invoking the setLocation-method from within the flutter plugin.


I hope you understand what I mean and anyway, thanks in advance


As this thread is already very long - can you please recap your latest issues with further details on the values, how you're doing the Flutter location handling,...


Thx and greetings

Nicola

Below you can see the output of the app, lines starting immediately with the coords are from flutter, the ones starting with CONSOLE from the sdk.
I am generally startled by the accuracy and the fact that the locationChanged of the SDK is called independently of the setLocation in flutter.

I hope you understand what I mean, thanks for your patience

 

 lati -15.7824589 - long 128.7346556 - alti 0.0 - accu 82.5
 lati -15.7816352 - long 128.7409094 - alti 0.0 - accu 2700.0
 [INFO:CONSOLE(99)] "sdk: lati -15.782459 longi 128.73465 alti -32768 accu 1"
 [INFO:CONSOLE(99)] "sdk: lati -15.782459 longi 128.73465 alti -32768 accu 1"
 lati -15.7816352 - long 128.7409094 - alti 0.0 - accu 2700.0
 [INFO:CONSOLE(99)] "sdk: lati -15.781635 longi 128.74091 alti -32768 accu 1"
 [INFO:CONSOLE(99)] "sdk: lati -15.781635 longi 128.74091 alti -32768 accu 1"
 [INFO:CONSOLE(99)] "sdk: lati -15.781635 longi 128.74091 alti -32768 accu 1"
 lati -15.7816352 - long 128.7409094 - alti 0.0 - accu 2700.0
 [INFO:CONSOLE(99)] "sdk: lati -15.781635 longi 128.74091 alti -32768 accu 1"
 [INFO:CONSOLE(99)] "sdk: lati -15.780281 longi 128.74156 alti -32768 accu 1"
 lati -15.7802814 - long 128.7415639 - alti 0.0 - accu 1000.0
 [INFO:CONSOLE(99)] "sdk: lati -15.780281 longi 128.74156 alti -32768 accu 1"
 [INFO:CONSOLE(99)] "sdk: lati -15.781635 longi 128.74091 alti -32768 accu 1"
 [INFO:CONSOLE(99)] "sdk: lati -15.781635 longi 128.74091 alti -32768 accu 1"
 lati -15.7816352 - long 128.7409094 - alti 0.0 - accu 2700.0

 

 

Hi Hendrik,


First of all, sorry for the late response.


The onLocationChanged callback is always being called by our SDK in the geo examples, but once the setLocation method is called by the Flutter code, we set the useCustomLocation parameter to true, so it doesn't update the location by its own. If you put the CONSOLE log inside the if, you will see that it is not called anymore.


On the other hand, we will check the altitude and the accuracy problem. In the meanwhile, you could test an altitude greater than 0.0 until the problem is fixed.


Thanks,


Aitor Font.

Login or Signup to post a comment