cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
thunter
Post Prodigy
Post Prodigy

Plot Latitude Longitude on Map

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!

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @thunter :

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
    }
)

 

Ive made a test for your reference:

Set the image controls 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:

Get a Static Map

 

Best Regards,

Bof

View solution in original post

11 REPLIES 11
thunter
Post Prodigy
Post Prodigy

I already am plotting the 1st Lat and Long using BingMaps. Is it best to put the list of Lat and Longs into a Collection? I have the Lat and Longs in a SQL table already that I could just pull in directly to PowerApps. Just not sure how to make BingMaps connector read multiple Lat and Longs?

 

Here is what I have so far:

bingpowerapps1.png

v-bofeng-msft
Community Support
Community Support

Hi @thunter :

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
    }
)

 

Ive made a test for your reference:

Set the image controls 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:

Get a Static Map

 

Best Regards,

Bof

View solution in original post

@v-bofeng-msft 

 

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 @thunter :

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

@v-bofeng-msft 

 

So here is what my table looks like that holds the latitude/longitude plots that I want to put on the map.

mapcoord1.png

@v-bofeng-msft 

 

Using your formula with my table and column names, and Bing Key the map does not show up.

 

mapcoord2.png

Hi @thunter 

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

 

@v-bofeng-msft 

 

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.

@v-bofeng-msft 

 

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?

 

maps6.png

Helpful resources

Announcements
User Groups Public Preview

Join us for our User Group Public Preview!

Power Apps User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (35,894)