Map in combination with locationsensor possible error?

Hello, it can be that there is an error with the loactionsensor in connection with the map (not google map).

Components used: Maps1, LocationsSensor1

components

Blocks used: Location Changes

blocks

Issue: nothing happens

normally my current position should be displayed in the map for every change (time interval 1000)? !

I’ve actually used the exact same elements in “MIT app inventor” everything worked there.

I have tested 3 different smartphones with different android versions (Android 7 bis 10)

Do I have to do anything different in kodular?
Can anyone confirm this incident?

Thank you for your efforts in advance

1 Like

Welcome to the community, for me it works ok but I set time interval to 60000 not 1000, see my blocks

Your problem is you didn’t set location sensor enabled to true. And after that you need to set time interval, then only app will take time to read your location. Just follow what @dora_paz mam tried.

Have you set properties

Tested android 10

1 Like

Hi,

I have set all the necessary settings and nothing happens, and when I do it in MIT inventor, it works …

look @ pix

best regards.

Did You Change This Value ?

sorry, but what difference does it make in function. i want the sensor to update its position every second.
It has to work in 1000 ms also as in 60000 (1 minute).
As I said in “MIT Inventor”, this instruction works without any problem, I don’t understand why not with kodular.

I’m not a Staff Kodular developer so I don’t know why this behavior on Kodular. I’m just trying to make it work. I use it with Google Maps and it works.

1 Like

Connect your project to :kodular: companion and go outside (outdoor) to get coordinates from the location sensor.

1 Like

Yes of course and it does.

It works also with Kodular (Companion & APK).

The blocks you posted are wrong. You inserted "altitude"into latitude . Also you should give “zoom” an int.

1 Like

Screenshot_20210531-064909

Hi,

Hello,

so here is an update of my previous experiences.
Yes, I had a mistake in my first attempt, I noticed it and corrected it promptly.
Here is a short code that had to work at times.

My components used:

Map1, Location_Sensor1, Label1 up to …Label5

I assume that this code is correct, if not please let me know if this is not correct.

I tested the exact same code in App Inventor with success.
In the meantime I’ve spent hours trying to figure out why I’m having these problems in Kodular.
First of all, I was only able to establish the connection to Companion with the latest version of Firefox. (Windows 10 latest version)
Chrome, Opera, Edge do NOT work. It always stays at 20% in the companion.
I even tested it in Firefox on Ubuntu 21.04, with three different smartphones, Android 7, 9 & 10.
So far, unfortunately WITHOUT success!

I don’t know what the problem is, I don’t get a display from Location_Sensor1.
And, yes, of course I went outside and tested it outside.
I tested in Kodular and then the exact same program with App Inventor.
It always worked with App Inventor.
By the way, the App Inventor also works on Chrome.

If anyone still has an idea what I could try, it would help me a lot, because I love to work with Kodular, that’s why I switched.

Best regards

This post was flagged by the community and is temporarily hidden.

Try this: Map_LocationSensor.apk (6.1 MB)
Does it work on your device?

It works e.g. on a

  • Galaxy Note8, Android 9
  • Pixel 2XL, Android 11.
Summary

Open a new project, add this block on Screen1:

grafik

In Designer:

grafik

1 Like

Thanks Anke, yes your APK worked well.
This gave me an idea and although I have a very scurille, I have found a solution.
Here’s what happened: The APK very quickly centered the map on my current position.
When I switched on “Show User” it stopped working, no idea why.
My guess is that Map1 and the instruction cannot access LocationSensor1 at the same time, this should be a bug.
After a few tests I found the following solution that works for me.

Block:

Sensor 1:
sensor1

Sensor 2:
sensor2

Strangely, it doesn’t matter whether I enable or disable locationsensor1.
Map1 is always updated.
I also deactivated both sensors at the same time and it was centered with the map, and of course “show user” was activated by Blocks.

Enclosed my file for testing:

TEST1.apk (6.1 MB)

Maybe someone would like / can try this APK.

Maybe anyone will test the .aia file: TEST1.aia (2.3 KB)

Thank you very much for your support, best regards

Even after waiting for 5min I didn’t get anything in the app. After few minutes later when I re-enter I get like this. Location sensor will take lot of time to read your position so better use map location block. It will give you the position faster than location sensor block

Works, no issues at all.

For me it works within a few (1-3) seconds.
Maybe it shouldn’t be tested in the basement. :wink:

1 Like

I uninstalled and reinstall, now working in few seconds. Morning may be issue with my location sensor or internet speed :+1:

It’s works ok (10 -15 seconds) :+1: