cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
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
Highlighted
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

Highlighted

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

Highlighted
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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (8,636)