cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Microsoft
Microsoft

Re: Plot Latitude Longitude on Map

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
Highlighted
Post Prodigy
Post Prodigy

Re: Plot Latitude Longitude on Map

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

Highlighted
Microsoft
Microsoft

Re: Plot Latitude Longitude on Map

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

Highlighted
Post Prodigy
Post Prodigy

Re: Plot Latitude Longitude on Map

@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!

Highlighted
Microsoft
Microsoft

Re: Plot Latitude Longitude on Map

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

Highlighted
Post Prodigy
Post Prodigy

Re: Plot Latitude Longitude on Map

@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

Highlighted
Post Prodigy
Post Prodigy

Re: Plot Latitude Longitude on Map

@v-bofeng-msft 

 

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

 

mapcoord2.png

Highlighted
Microsoft
Microsoft

Re: Plot Latitude Longitude on Map

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

 

Highlighted
Post Prodigy
Post Prodigy

Re: Plot Latitude Longitude on Map

@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.

Highlighted
Post Prodigy
Post Prodigy

Re: Plot Latitude Longitude on Map

@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
Check this Out

Announcing

Class of 2020- Season 2

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,066)