Hi @Sdhn :
As far as @JayMagness said,you can use a timer control to record the user's location at regular intervals.Then use BingMaps.GetRoute to get the distance between each checkpoint, and finally add them up.
I've made a test for your reference:
1\Add a button and set
OnSelect
Set(start,!start) /*start is my variable*/
Text
If(start,"Stop","Start")
2\Add a timer control and set
Duration
10000 /*loop in 10s*/
OnTimerEnd
Collect(
StepPoint,
{
thepoing:Location.Latitude&","&Location.Longitude
}
);/*StepPoint is my custom collection for saving checkpoints*/
If(
CountRows(StepPoint)>1,
Collect(
TheDistance, /*TheDistance is my custom collection for Calculation distance*/
{
Value:BingMaps.GetRoute(
First(LastN(StepPoint,2)).thepoing,
Last(StepPoint).thepoing
).travelDistance
}
)
)
Repeat
true
Start
start /*start is my custom variable*/
Visible
false /*make this control unvisible*/
3\Add a button(Reset)
OnSelect
Clear(StepPoint);Clear(TheDistance)
Text
"Reset"
4\Add a label control to display the distense
Text
Sum(TheDistance,Value)
When the user clicks on start, the app records the current user's position every 10 seconds and calculates the distance between the user's current position and the previous position and saves it to the set TheDistance.
Using sum to calculate the sum of Value in TheDistance can only know how much distance the user has moved after clicking start.
In addition,I think this link will help you a lot:
Bing Maps (Preview)
Best Regards,
Bof