Skip to main content

Notifications

Community site session details

Community site session details

Session Id : ENaZtvqQ18enB+jWyS0FLB
Power Apps - Building Power Apps
Answered

Plot Latitude Longitude on Map

Like (0) ShareShare
ReportReport
Posted on 23 Apr 2020 19:59:21 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!

  • Community Power Platform Member Profile Picture
    on 05 May 2020 at 11:39:19
    Re: Plot Latitude Longitude on Map

    @v-bofeng-msft 

    It is all working now. Thank you for your help!

  • v-bofeng-msft Profile Picture
    on 05 May 2020 at 01:30:52
    Re: Plot Latitude Longitude on Map

    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

  • Community Power Platform Member Profile Picture
    on 04 May 2020 at 15:53:10
    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

  • Community Power Platform Member Profile Picture
    on 04 May 2020 at 11:28:52
    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.

  • v-bofeng-msft Profile Picture
    on 04 May 2020 at 01:33:09
    Re: Plot Latitude Longitude on Map

    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 30 Apr 2020 at 15:15:33
    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

  • Community Power Platform Member Profile Picture
    on 30 Apr 2020 at 14:59:00
    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

  • v-bofeng-msft Profile Picture
    on 27 Apr 2020 at 01:36:13
    Re: Plot Latitude Longitude on 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

  • Community Power Platform Member Profile Picture
    on 24 Apr 2020 at 14:50:02
    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!

  • Verified answer
    v-bofeng-msft Profile Picture
    on 24 Apr 2020 at 06:26:07
    Re: Plot Latitude Longitude on Map

    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:

    Get a Static Map

     

    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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,765 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard
Loading started