Skip to main content

Notifications

Community site session details

Community site session details

Session Id : siesL8701TuvHJiCW69hhr
Power Apps - Building Power Apps
Answered

Bing Map inside canvas apps

Like (0) ShareShare
ReportReport
Posted on 18 Mar 2020 11:48:46 by 373

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.

  • v-siky-msft Profile Picture
    on 24 Mar 2020 at 05:40:15
    Re: Bing Map inside canvas apps

    Hi @NurNina ,

    As I mentioned in the screenshot, If the Text boxes are not entered, that waypoint is not added into the URL.

    You can use Label to show the URL, you will find the effect of these conditions.

    Sik

  • NurNina Profile Picture
    373 on 24 Mar 2020 at 04:16:42
    Re: Bing Map inside canvas apps

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

  • Verified answer
    v-siky-msft Profile Picture
    on 24 Mar 2020 at 03:35:52
    Re: Bing Map inside canvas apps

    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
    373 on 24 Mar 2020 at 02:51:30
    Re: Bing Map inside canvas apps

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


    link location.PNG

  • v-siky-msft Profile Picture
    on 23 Mar 2020 at 04:26:19
    Re: Bing Map inside canvas apps

    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
    373 on 23 Mar 2020 at 02:17:23
    Re: Bing Map inside canvas apps

    @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 20 Mar 2020 at 05:34:58
    Re: Bing Map inside canvas apps

    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
    373 on 20 Mar 2020 at 05:19:25
    Re: Bing Map inside canvas apps

    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 20 Mar 2020 at 03:49:43
    Re: Bing Map inside canvas apps

    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
    373 on 20 Mar 2020 at 03:06:07
    Re: Bing Map inside canvas apps

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

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,743 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,079 Most Valuable Professional

Leaderboard