web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Plot Latitude Longitud...
Power Apps
Unanswered

Plot Latitude Longitude on Map

(0) ShareShare
ReportReport
Posted on by

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!

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

    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

  • Verified answer
    v-bofeng-msft Profile Picture
    on at

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

     

    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

  • Community Power Platform Member Profile Picture
    on at

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

  • v-bofeng-msft Profile Picture
    on at

    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

  • Community Power Platform Member Profile Picture
    on at

    @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

  • Community Power Platform Member Profile Picture
    on at

    @v-bofeng-msft 

     

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

     

    mapcoord2.png

  • v-bofeng-msft Profile Picture
    on at

    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

     

  • Community Power Platform Member Profile Picture
    on at

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

  • Community Power Platform Member Profile Picture
    on at

    @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

  • v-bofeng-msft Profile Picture
    on at

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard