I am trying to create an app that I can plot multiple latitude and longitude points on map. We are a trucking company and I want to be able to create breadcrumb trails for our trucks. So essentialy in the powerapp, you would enter the truck number and date range and then the powerapp will plot coordinates on a map. Is there any documentation for this or does anyone have a helpful solutions? Thank you very much!
Hi @Anonymous
I suggest you try to put this code in the text property of label control to see if it works.
Best Regards,
Bof
I used the same formula as you, except I am using my SQL table instead of a Collection. Any ideas why I am not getting any results?
Would it make a difference that my data source is a SQL table and not a Collection? I think that is the only thing different from what I did.
Hi @Anonymous
I did the same test, but did not encounter the problem you mentioned.
my data source:
ClearCollect(
truck,
{
TurckNmumber: "JGH001",
Latitude: 35.15,
longitude: -90.13
},
{
TurckNmumber: "2702",
Latitude: 41.27,
longitude: -95.93
},
{
TurckNmumber: "11012694",
Latitude: 41.27,
longitude: -95.93
},
{
TurckNmumber: "11006289",
Latitude: 41.27,
longitude: -95.93
},
{
TurckNmumber: "2037",
Latitude: 41.89,
longitude: -112.23
}
)
Map:
"https://dev.virtualearth.net/REST/v1/Imagery/Map/Road?&"
&
Concat(AddColumns(
truck,
"pp",
"pp=" & Latitude & "," & longitude & ";" & 2 & ";" & TurckNmumber
),
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*/
I suggest you check your data source, field name, data type,KEY.
Best Regards,
Bof
Using your formula with my table and column names, and Bing Key the map does not show up.
So here is what my table looks like that holds the latitude/longitude plots that I want to put on the map.
Hi @Anonymous :
Q1:Is there anyway to get a line connecting the plots on the map?
Please try this code:
"https://dev.virtualearth.net/REST/v1/Imagery/Map/Road?&"
&
Concat(AddColumns(
truck,
"pp",
"pp=" & lat & "," & Long & ";" & 21 & ";" & truckname
),
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*/
I think this link will help you a lot:
Draw Pushpoints on a map of the USA using the drawCurve Parameter
Q2:Also, does Power Apps have functionality to make the map interactive; so when you hover over a plot on the map you get an info box pop up?
Since you are getting a static map, I am afraid that it does not have the ability to interact with users.But you can dynamically adjust the parameters of the URL by configuring external controls, which seems to be the only way to interact with the map.
Best Regards,
Bof
Is there anyway to get a line connecting the plots on the map? Also, does Power Apps have functionality to make the map interactive; so when you hover over a plot on the map you get an info box pop up? Thanks!
Hi @Anonymous :
Do you want to show multiple points in a Bing map?
The key is using URL.( Get a map with pushpins that does not specify a center point or map area)
I assume that the data structure of your data source is the same as mine.
My data source: truck
ClearCollect(
truck,
{
truckname: "AA",
lat: 39.83,
Long: -100.51
},
{
truckname: "BB",
lat: 45.67,
Long: -122.81
}
)
I’ve made a test for your reference:
Set the image control’s image property to :
"https://dev.virtualearth.net/REST/v1/Imagery/Map/Road?&"
&
Concat(AddColumns(
truck,
"pp",
"pp=" & lat & "," & Long & ";" & 21 & ";" & truckname
),
pp,
"&"
) /*Adjust the data table to the string required by the URL through the combination functions*/
&
"&key=AivzmzqHNnj7ZFj1kBy-y3jwUi47k786wERV8Z-5HN4hnwqRtArHBQnfyjpxnVZV" /*” Aivzmzq……“ is my key*/
I think this link will help you a lot:
Best Regards,
Bof
WarrenBelz
146,765
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional