cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mfonjames
Frequent Visitor

How to embed google map with direction indicator in power apps

Hello House,

 

I want to be able to display google map with street indicator from point A to point B i.e. from current position to destionation address, i have tried this:

 

"https://maps.googleapis.com/maps/api/directions/json?origin="&Location.Latitude&","&Location.Longitu..."," &BrowseGallery1.Selected.X_COORDINATE&"&key=xxxxxxxxxxx"

 

the above code does not display the map nor throw any error, i will appreciate if anyone could assist. 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @mfonjames ,

Do you want to embed a Google map with direction indicator within your canvas app?

Do you use Image control to display your Google map?

 

Based on the formula that you mentioned, I think you have some misunderstanding with the Google Directions API (https://maps.googleapis.com/maps/api/directions/outputFormat?parameters).

The output of Google Directions API is a JSON data or a XML data, not a Image data. Please check the following article for more details:

https://developers.google.com/maps/documentation/directions/intro

 

If you want to display Google map within your canvas app using Image control, you must call Google Maps Static API. More details about Google Maps Static API, please check the following:

https://developers.google.com/maps/documentation/maps-static/dev-guide#Paths

 

Based on the needs that you mentioned, I afraid that the Google Static Map API could not achieve your needs within PowerApps currently.

As an alternative solution, I think the Bing Maps Imagery API could achieve your needs. I have made a test on my side, please take a try with the following workaround:4.JPG

Set the Image property of the Image control to following:

"https://dev.virtualearth.net/REST/v1/Imagery/Map/Road/Routes?wp.0="&Location.Latitude&","&Location.Longitude&";64;1&wp.1="&"36.215539,138.203574"&";66;2"&"&key="&txtBingMapsKey.Text

On your side, you should type:

"https://dev.virtualearth.net/REST/v1/Imagery/Map/Road/Routes?wp.0="&Location.Latitude&","&Location.Longitude&";64;1&wp.1="&BrowserGallery1.Selected.Latitute&","BrowserGallery1.Selected.Longitute&&";66;2"&"&key="&txtBingMapsKey.Text

Note: The Latitute and Longitute represents the Latitute/Longtitute value of the Destination address, which selected from your Gallery.

Please check the following article for more details:

https://docs.microsoft.com/en-us/bingmaps/rest-services/imagery/get-a-static-map#get-a-map-with-road...

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-xida-msft
Community Support
Community Support

Hi @mfonjames ,

Do you want to embed a Google map with direction indicator within your canvas app?

Do you use Image control to display your Google map?

 

Based on the formula that you mentioned, I think you have some misunderstanding with the Google Directions API (https://maps.googleapis.com/maps/api/directions/outputFormat?parameters).

The output of Google Directions API is a JSON data or a XML data, not a Image data. Please check the following article for more details:

https://developers.google.com/maps/documentation/directions/intro

 

If you want to display Google map within your canvas app using Image control, you must call Google Maps Static API. More details about Google Maps Static API, please check the following:

https://developers.google.com/maps/documentation/maps-static/dev-guide#Paths

 

Based on the needs that you mentioned, I afraid that the Google Static Map API could not achieve your needs within PowerApps currently.

As an alternative solution, I think the Bing Maps Imagery API could achieve your needs. I have made a test on my side, please take a try with the following workaround:4.JPG

Set the Image property of the Image control to following:

"https://dev.virtualearth.net/REST/v1/Imagery/Map/Road/Routes?wp.0="&Location.Latitude&","&Location.Longitude&";64;1&wp.1="&"36.215539,138.203574"&";66;2"&"&key="&txtBingMapsKey.Text

On your side, you should type:

"https://dev.virtualearth.net/REST/v1/Imagery/Map/Road/Routes?wp.0="&Location.Latitude&","&Location.Longitude&";64;1&wp.1="&BrowserGallery1.Selected.Latitute&","BrowserGallery1.Selected.Longitute&&";66;2"&"&key="&txtBingMapsKey.Text

Note: The Latitute and Longitute represents the Latitute/Longtitute value of the Destination address, which selected from your Gallery.

Please check the following article for more details:

https://docs.microsoft.com/en-us/bingmaps/rest-services/imagery/get-a-static-map#get-a-map-with-road...

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hello Support,

 

Thanks for your response. I have tried from the example you gave, still map didnt show.

below is my url:

"https://dev.virtualearth.net/REST/v1/Imagery/Map/Road/Routes?wp.0="&Location.Latitude&","&Location.L...

 

I am using image to display the map, i will appreciate if you could tell what i am missing. Thanks

mfonjames
Frequent Visitor

I have a field in a SharePoint List that stores date in "dd/mm/yyyy" format, i want to be to retrieve this fields and compares it with the current date using month and year only. below is what i have tried, but it's throwing error:

 

LookUp('Imprest Budget', And(DepartmentText = dept.Value, Text(Month, "[$-en-GB]mm/yyyy") = Text(Today(), "[$-en-GB]mm/yyyy")),Text(Value(Balance),"[$-en-GB]###,###,###.00"))

 

I will appreciate if anyone could assist.

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,408)