cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerAppsDawg
Frequent Visitor

Bing Maps - Persistent Pushpins

Hi Community,

 

So I'm seeing if I can create a rudimentary fitness tracker in power apps. I cant see a way to trace routes like strava so I was hoping that I could use a dot (pushpin) placed every five seconds to get a similar effect. 

 

The app is currently set up with the following in the on timer end property of a timer

 

Set(workoutLat,Location.Latitude);Set(workoutLong,Location.Longitude);Collect(FitBugActivityRecords,Defaults(FitBugActivityRecords),{Latitude:workoutLat,Longitude:workoutLong})
 
this sets the lat and long in a variable - i then use the below in a statement to bingmaps 
 
BingMaps.GetMap(
"CanvasGray",
17,
workoutLat,
workoutLong,
{pushpin: workoutLat & "," & workoutLong & ";67"}
)
 
the issue i have is how do I get the pushpin to persist once its been set. currently the value of the pin is reset each time a new lat and long variable is given. is there a way to append an additional pushpin into the statement to bing maps
 
Many thanks for your help.
 
If i can get it to work i'll post a guide, it might help others
 
All the bes
 
 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @PowerAppsDawg :

Do you want to show multiple points in a Bing map?

Do you want to draw a movement track according to the user's walking route?

The key is using URL.(Draw Pushpoints on a map of the USA using the drawCurve Parameter)

The first important issue I want to explain is that the number of these points is limited.

If you use the HTTP GET method with any of the following URL templates, you can specify up to 18 pushpins in the URL. 

Secondly,my suggestion is to increase the sampling interval according to your needs (such as 8 minutes), and then connect these points with a line.

I've made a test for your reference:

My data source(SharePoint List): BingMap (You need a database to store data)

TitleSingle line of text
LatitudeSingle line of text
longitudeSingle line of text

1/Add a Text Input control(TextInput1/*Create Event Theme*/

2/Add a timer control./*used to upload location information regularly.*/

Duration:

480000 /*8 minutes between each upload*/

OnTimerStart:

 

Patch(
    BingMap,
    Defaults(BingMap),
    {
        Title: TextInput1.Text,
        Latitude: Location.Latitude,
        longitude: Location.Longitude
    }
)

 

Repeat:

true

OnSelect:

 

UpdateContext({var:!var}) /*Var is my custom variable*/

 

Text:

 

If(var,"Stop","Start") /*Make the timer more user-friendly. When "Start" is displayed, the user can click Start, and then it will display "Stop".*/

 

3\Add a image control:

Image:

 

"https://dev.virtualearth.net/REST/v1/Imagery/Map/Road?&"
&
Concat(AddColumns(
        Filter(BingMap,Title=TextInput1.Text),/*Only need the activity track of this activity*/
        "pp",
        "pp=" & Latitude & "," & longitude & ";" & 2 & ";"
    ),
    pp,
    "&"
) /*Adjust the data table to the string required by the URL through the combination functions*/             
&"&dc=l,,3"&
"&key=AivzmzqHNnj7ZFj1kBy-y3jwUi47k786wERV8Z-5HN4hnwqRtArHBQnfyjpxnVZV"    /*” Aivzmzq……“ is my key*/

 

1.jpg

/*To present the results, I used experimental data (not real data)*/

Best Regards.

Bof

 

 

 

View solution in original post

1 REPLY 1
v-bofeng-msft
Community Support
Community Support

Hi @PowerAppsDawg :

Do you want to show multiple points in a Bing map?

Do you want to draw a movement track according to the user's walking route?

The key is using URL.(Draw Pushpoints on a map of the USA using the drawCurve Parameter)

The first important issue I want to explain is that the number of these points is limited.

If you use the HTTP GET method with any of the following URL templates, you can specify up to 18 pushpins in the URL. 

Secondly,my suggestion is to increase the sampling interval according to your needs (such as 8 minutes), and then connect these points with a line.

I've made a test for your reference:

My data source(SharePoint List): BingMap (You need a database to store data)

TitleSingle line of text
LatitudeSingle line of text
longitudeSingle line of text

1/Add a Text Input control(TextInput1/*Create Event Theme*/

2/Add a timer control./*used to upload location information regularly.*/

Duration:

480000 /*8 minutes between each upload*/

OnTimerStart:

 

Patch(
    BingMap,
    Defaults(BingMap),
    {
        Title: TextInput1.Text,
        Latitude: Location.Latitude,
        longitude: Location.Longitude
    }
)

 

Repeat:

true

OnSelect:

 

UpdateContext({var:!var}) /*Var is my custom variable*/

 

Text:

 

If(var,"Stop","Start") /*Make the timer more user-friendly. When "Start" is displayed, the user can click Start, and then it will display "Stop".*/

 

3\Add a image control:

Image:

 

"https://dev.virtualearth.net/REST/v1/Imagery/Map/Road?&"
&
Concat(AddColumns(
        Filter(BingMap,Title=TextInput1.Text),/*Only need the activity track of this activity*/
        "pp",
        "pp=" & Latitude & "," & longitude & ";" & 2 & ";"
    ),
    pp,
    "&"
) /*Adjust the data table to the string required by the URL through the combination functions*/             
&"&dc=l,,3"&
"&key=AivzmzqHNnj7ZFj1kBy-y3jwUi47k786wERV8Z-5HN4hnwqRtArHBQnfyjpxnVZV"    /*” Aivzmzq……“ is my key*/

 

1.jpg

/*To present the results, I used experimental data (not real data)*/

Best Regards.

Bof

 

 

 

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (49,739)