Hi, I have a map with a few pin of locations :
but the route from 1 location to next location is not showing. I want the map to display like this :
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.
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
@v-siky-msft thank you so much. it works! why do we need to add the condition by the way
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:
Sik
@v-siky-msft I dont think there's anything wrong with the latitude and longitude
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.
Hope this helps.
Sik
@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:
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
)
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
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?
Hi @NurNina
I made a test just now, and the code can work well.
Please ensure all the Text input box names are correct.
Sik
@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?
WarrenBelz
146,743
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,079
Most Valuable Professional