I am using the Google Maps Static Map API and am able to plot multiple coordinates on my map based on a SQL table with columns for Latitude and Longitude. However, I cannot get the PATH parameter to work. Does anyone know how to use the PATH parameter correctly. I have spent a lot of time reading through Google documentation without any luck. Here is what I have:
Solved! Go to Solution.
Hi @thunter ,
Yes, there is a limitation that you can specify up to 18 pushpins in the URL.
To achieve Zoom in/out function, you need to define a center point and a Zoom level after the Road before Route.
In your case, please try this, set the first point to center point, use slider control to control the zoom level.
"https://dev.virtualearth.net/REST/v1/Imagery/Map/Road/"&First(colNumberedTrucks).Latitude&","& First(colNumberedTrucks).Longitude&"/"&Slider1.Value&"/Routes?"& Concat(colNumberedTrucks,"wp."& RowNumber & "=" & Latitude &","&Longitude&";66;" &RowNumber&"&") &"key={BingMapsAPIKey}"
Hope this helps.
Sik
Hi @thunter ,
I couldn't test the Google maps API because it seemed to require a billing account, but I've worked on the Bing map API with the same requirements you mentioned.
If you have insterst in Bing Map API, please take reference on this thread or this document.
Hope this helps.
Sik
Thanks for all the info and documentation on Bing Maps. I have no issue using either Bing or Google; just a map that I can show routes on. I was able to get the example Bing Map to work with a route using the following code in PowerApps:
I am just not sure how to combine the custom PowerApps formula into the above Bing formula. Here is my formula Google map in PowerApps with all my coordinates plotted on the map:
"https://maps.googleapis.com/maps/api/staticmap?center= " & First(colTrucks).Latitude & "," & First(colTrucks).Longitude & "&zoom="&Slider1.Value&"&size=1340x404&key=AIzaSyB6H-z3ikRFI3RseejUY1YHf9C0_OFSFnw"&Concat(colTrucks,"&markers=size:tiny%7Ccolor:red%7Clabel:%7C" & Latitude & "," & Longitude & "&path=weight:3|color:blue" & Latitude & "," & Longitude)
Any idea how to get the Lat and Longs to work with Bing? Thank you!
Hi @thunter ,
So there is a table colTrucks with Latitude and Longitude column, right?
First, please try this code to add the Row Numbers for each row of colTrucks.
Clear(colNumberedTrucks);
ForAll(colTrucks,
Collect(colNumberedTrucks,
Last(FirstN(AddColumns(colTrucks,
"RowNumber",
CountRows(colNumberedTrucks)+1
),
CountRows(colNumberedTrucks)+1
)
)
)
)
Then, please try this:
"https://dev.virtualearth.net/REST/v1/Imagery/Map/Road/Routes?"& Concat(colNumberedTrucks,"wp."& RowNumber & "=" & Latitude &","&Longitude&";66;" &RowNumber&"&") &"key="&txtBingMapsKey.Text
Hope this helps.
Sik
Thank you for all your help. I tried what you said and not getting any data on my Map image. I do have data in the Collection though so not sure why it isnt showing up on Map.
Sorry, forgot to attach this image showing the data is in the Collection by using DataTable.
Hi @thunter ,
Could you please show the parsed URL by a Label shown as below?
How many waypoints do you want to display?
So far, the possible reason is that the RowNumber doesn't start at 1, since seemly the waypoints are from 58-70 shown in your DataTable. RowNumbers are the index of each waypoint in the URL, it must start at 1 and gradually increase for other waypoints, as shown below.
https://dev.virtualearth.net/REST/v1/Imagery/Map/Road/Routes?wp.1=Seattle,WA;64;1&wp.2=Redmond,WA;66;2&key={BingMapsAPIKey}
Of course, in order to debug the problem accurately, please provide the parsed URL. you can also follow the example above to determine where your URL is wrong.
Thanks.
Sik
I was able to get the line to print, however, sometimes the line and coordinates do not show up on Map. Is there a limit to the number of plots that can show on the map? It seems to not work when I have a lot of plots. Also, do you know how to incorporate Zoom with using a Slider control for BING maps? Thanks!
Hi @thunter ,
Yes, there is a limitation that you can specify up to 18 pushpins in the URL.
To achieve Zoom in/out function, you need to define a center point and a Zoom level after the Road before Route.
In your case, please try this, set the first point to center point, use slider control to control the zoom level.
"https://dev.virtualearth.net/REST/v1/Imagery/Map/Road/"&First(colNumberedTrucks).Latitude&","& First(colNumberedTrucks).Longitude&"/"&Slider1.Value&"/Routes?"& Concat(colNumberedTrucks,"wp."& RowNumber & "=" & Latitude &","&Longitude&";66;" &RowNumber&"&") &"key={BingMapsAPIKey}"
Hope this helps.
Sik
User | Count |
---|---|
195 | |
123 | |
86 | |
48 | |
40 |
User | Count |
---|---|
281 | |
165 | |
139 | |
80 | |
76 |