Sergey_New Well-Known Member Licensed User Longtime User Apr 26, 2024 #1 Please help me indicate "My location" on Google Maps.
Andrew (Digitwell) Well-Known Member Licensed User Longtime User Apr 28, 2024 #21 Sergey_New said: This is in the main program, I just carelessly transferred it to the example. For the same reason Никогда не использовал его раньше. Подскажите пожалуйста, как это сделать правильно. Спасибо за участие и советы! Click to expand... there example of timers in the B4X manual Upvote 0
Sergey_New said: This is in the main program, I just carelessly transferred it to the example. For the same reason Никогда не использовал его раньше. Подскажите пожалуйста, как это сделать правильно. Спасибо за участие и советы! Click to expand... there example of timers in the B4X manual
Sergey_New Well-Known Member Licensed User Longtime User May 3, 2024 #22 I made an example using a timer (MyLocation). I conduct a survey every second, everything is fine. I tried using ResumableSub (MyLocation2). Works only when in debug mode if you create a breakpoint on the line B4X: Expand Collapse Copy If gmap.MyLocation.IsInitialized Then Applying a delay doesn't help. What am I doing wrong? Attachments MyLocation.zip MyLocation.zip 4 KB · Views: 262 MyLocation2.zip MyLocation2.zip 4 KB · Views: 272 Upvote 0
I made an example using a timer (MyLocation). I conduct a survey every second, everything is fine. I tried using ResumableSub (MyLocation2). Works only when in debug mode if you create a breakpoint on the line B4X: Expand Collapse Copy If gmap.MyLocation.IsInitialized Then Applying a delay doesn't help. What am I doing wrong?
Andrew (Digitwell) Well-Known Member Licensed User Longtime User May 5, 2024 #23 The time only needs to be initialized once the I think that your problem is that it is taking a while for your GPS to get a fix. Just waiting for 200ms may not be enough. I would suggest that you add a log instead of reinitializing the timer, which is unnecessary. That will tell you how many times the timer ticked before the location was available. With the Wait for you only check once and if the location is not available then you stop. So that is the key difference. Upvote 0
The time only needs to be initialized once the I think that your problem is that it is taking a while for your GPS to get a fix. Just waiting for 200ms may not be enough. I would suggest that you add a log instead of reinitializing the timer, which is unnecessary. That will tell you how many times the timer ticked before the location was available. With the Wait for you only check once and if the location is not available then you stop. So that is the key difference.
Sergey_New Well-Known Member Licensed User Longtime User May 6, 2024 #24 Andrew (Digitwell) said: The time only needs to be initialized once the Click to expand... Did you miss something after the words...? Upvote 0
Andrew (Digitwell) said: The time only needs to be initialized once the Click to expand... Did you miss something after the words...?
Andrew (Digitwell) Well-Known Member Licensed User Longtime User May 6, 2024 #25 Sergey_New said: Did you miss something after the words...? Click to expand... I mean to to say "the timer only needs to initialized once" Upvote 0
Sergey_New said: Did you miss something after the words...? Click to expand... I mean to to say "the timer only needs to initialized once"
Sergey_New Well-Known Member Licensed User Longtime User May 6, 2024 #26 Andrew (Digitwell) said: the timer only needs to initialized once Click to expand... I initialize the timer every second because I don't know how long it will take to get the geolocation. Upvote 0
Andrew (Digitwell) said: the timer only needs to initialized once Click to expand... I initialize the timer every second because I don't know how long it will take to get the geolocation.
Alexander Stolte Expert Licensed User Longtime User May 6, 2024 #27 Sergey_New said: I initialize the timer every second because I don't know how long it will take to get the geolocation. Click to expand... but then turn off the timer as soon as the location has been found? Upvote 0
Sergey_New said: I initialize the timer every second because I don't know how long it will take to get the geolocation. Click to expand... but then turn off the timer as soon as the location has been found?
Sergey_New Well-Known Member Licensed User Longtime User May 6, 2024 #28 Alexander Stolte said: but then turn off the timer as soon as the location has been found? Click to expand... Yes, that's what I want to do. Upvote 0
Alexander Stolte said: but then turn off the timer as soon as the location has been found? Click to expand... Yes, that's what I want to do.
Andrew (Digitwell) Well-Known Member Licensed User Longtime User May 10, 2024 #29 But there is no need to re-initialise the timer. it will stay running until you set enabled to false. The rest should just work. Upvote 0
But there is no need to re-initialise the timer. it will stay running until you set enabled to false. The rest should just work.
Sergey_New Well-Known Member Licensed User Longtime User May 10, 2024 #30 Andrew (Digitwell) said: But there is no need to re-initialise the timer. Click to expand... Thanks I got it! Upvote 0
Andrew (Digitwell) said: But there is no need to re-initialise the timer. Click to expand... Thanks I got it!