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 / Bing Map inside canvas...
Power Apps
Answered

Bing Map inside canvas apps

(0) ShareShare
ReportReport
Posted on by 375

Hi, I have a map with a few pin of locations : 

snip1.PNG

but the route from 1 location to next location is not showing.  I want the map to display like this : 

 

snip2.PNG
I store the latitude and longitude inside a textbox:
"https://dev.virtualearth.net/REST/v1/Imagery/Map/Road/Routes?wp.0="& Seq1_Lat_1.Text & "," & Seq1_Long_1.Text & ";66;1&wp.1=" & Seq2_Lat_1.Text & "," & Seq2_Long_1.Text & ";66;2&wp.2=" & Seq3_Lat_1.Text & "," & Seq3_Long_1.Text & ";66;3&wp.3=" & Seq4_Lat_1.Text & "," & Seq4_Long_1.Text & ";66;4&wp.4=" & Seq5_Lat_1.Text & "," & Seq5_Long_1.Text & ";66;5&key=" & txtBingMapsKey_2.Text

how can I get the map to show the blue line like in the image 2.

Categories:
I have the same question (0)
  • v-siky-msft Profile Picture
    on at

    Hi @NurNina ,

     

    Do you mean you only want to show the route between Location1 and location2, show pushpins on other locations?

    From the Get Statics Map API of BingMap, we can know that If you want to show route, the parameter should start with wp.n, if you want to show pushpins, the parameter should start with pp.

    So, try to modify your URL as below.

    "https://dev.virtualearth.net/REST/v1/Imagery/Map/Road/Routes?wp.0="& Seq1_Lat_1.Text & "," & Seq1_Long_1.Text & ";66;1&wp.1=" & Seq2_Lat_1.Text & "," & Seq2_Long_1.Text & ";66;2&pp=" & Seq3_Lat_1.Text & "," & Seq3_Long_1.Text & ";66;3&pp=" & Seq4_Lat_1.Text & "," & Seq4_Long_1.Text & ";66;4&pp=" & Seq5_Lat_1.Text & "," & Seq5_Long_1.Text & ";66;5&key=" & txtBingMapsKey_2.Text

    Test Reust:

    Snipaste_2020-03-19_13-50-53.png

    Hope this helps.

    Sik

  • NurNina Profile Picture
    375 on at

    @v-siky-msft I want the blue line of the route to show. But when I put the latitude and longitude inside text label,the blue route line doesn't show. When I put the latitude and longitude straight away inside the link, the blue route line is shown. Why is that?

  • v-siky-msft Profile Picture
    on at

    Hi @NurNina 

    I made a test just now, and the code can work well.

    Please ensure all the Text input box names are correct.

    Annotation 2020-03-20 114617.png

    Sik

  • NurNina Profile Picture
    375 on at

    I think mine is not showing because the value inside the textbox does not have double quote. If a textbox has a lookup value, how do I put the value inside a double quote?

  • v-siky-msft Profile Picture
    on at

    Hi @NurNina ,

     

    What does it mean that a textbox has a lookup value?

    If the values reference from the Text of Textbox, there is no need to use double quote around them.

    Could you share some detailed steps about how do you implement this?
    Sik

  • NurNina Profile Picture
    375 on at

    @v-siky-msft what im having right now is : 

    "https://dev.virtualearth.net/REST/v1/Imagery/Map/Road/Routes?wp.0="& Seq1_Lat.Text & "," & Seq1_Long.Text & ";66;1&wp.1=" & Seq2_Lat.Text & "," & Seq2_Long.Text & ";66;2&wp.2=" & Seq3_Lat.Text & "," & Seq3_Long.Text & ";66;3&wp.3=" & Seq4_Lat.Text & "," & Seq4_Long.Text & ";66;4&wp.4=" & Seq5_Lat.Text & "," & Seq5_Long.Text & ";66;5&key=" & txtBingMapsKey.Text

    and the map does not show the route, only the pushpin: 
    snip1.PNG

    I use lookup function to get the latitude and longitude and put it inside textbox. for example: 

    Textbox Seq1_Lat : 
    LookUp(
    RouteTables,
    RouteID = ddRouteID.Selected.Result && WalkingSequence = "1" && EmployeeID = EmpID.Text,
    Latitude_1
    )

    Textbox Seq1_Long:
    LookUp(
    RouteTables,
    RouteID = ddRouteID.Selected.Result && WalkingSequence = "1" && EmployeeID = EmpID.Text,
    Longitude_1
    )

     

  • v-siky-msft Profile Picture
    on at

    Hi @NurNina ,

     

    To debug your issue, please try to create a label and set Text property of label to ImageName.Image to show the Map link URL. 

    It is easier for us to find out the issue, you can also check to see if there are any differences from hardcoded latitude and longitude links.

    Snipaste_2020-03-23_12-27-13.png

    Hope this helps.

    Sik

     

  • NurNina Profile Picture
    375 on at

    @v-siky-msft I dont think there's anything wrong with the latitude and longitude 


    link location.PNG

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

    Hi @NurNina ,

     

    Thanks, I finally reproduce your issue.

    You must enter the latitude and longitude of all five waypoints before it shows the route.

    As an alternative workaround, I add the condition before each waypoint to check if the text box is blank. Please try this code:

     

    "https://dev.virtualearth.net/REST/v1/Imagery/Map/Road/Routes?"&
    If(!IsBlank(Seq1_Lat_1.Text)&&!IsBlank(Seq1_Long_1.Text),"wp.0="& Seq1_Lat_1.Text & "," & Seq1_Long_1.Text & ";66;1&") &
    If(!IsBlank(Seq2_Lat_1.Text)&&!IsBlank(Seq2_Long_1.Text),"wp.1=" & Seq2_Lat_1.Text & "," & Seq2_Long_1.Text & ";66;2&") &
    If(!IsBlank(Seq3_Lat_1.Text)&&!IsBlank(Seq3_Long_1.Text),"wp.2=" & Seq3_Lat_1.Text & "," & Seq3_Long_1.Text & ";66;3&") &
    If(!IsBlank(Seq4_Lat_1.Text)&&!IsBlank(Seq4_Long_1.Text),"wp.3=" & Seq4_Lat_1.Text & "," & Seq4_Long_1.Text & ";66;4&") &
    If(!IsBlank(Seq5_Lat_1.Text)&&!IsBlank(Seq5_Long_1.Text),"wp.4=" & Seq5_Lat_1.Text & "," & Seq5_Long_1.Text & ";66;5&") & 
    "key="&txtBingMapsKey_2.Text

     

     

    Test Result:

    Snipaste_2020-03-24_11-34-54.png

    Sik

  • NurNina Profile Picture
    375 on at

    @v-siky-msft thank you so much. it works! why do we need to add the condition by the way

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard