cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mike8
Level 10

Re: Google map and pin in PowerApps

Hello

 

Is it possible that you have put the latitude and longitude wrong? Try to change the order. For example if you have y for latitude and x for longitude, change it and have x for latitude and y for longitude.

 

Kind regards,

Mike

Lorcan
Level: Powered On

Re: Google map and pin in PowerApps

Hi Mike

I believe my problem is because I have not yet added my Google API key to my PowerApps Connections.

I have tried many URL's with my API key inside and I cannot seem to crack it.

Have you gotten past this screen shot before?:

Untitled-1.jpg

I greatly appreciate your concern Mike! You're a good man! Smiley Happy

Regards
Lorcan

Mike8
Level 10

Re: Google map and pin in PowerApps

Hello Lorcan,

 

I followed Mark's instructions and it worked for me. 
I thought that you said that you had a foreign location on the map and I thought that you had just put the coordinates in the wrong order. I don't know if your problem is that haven't added the API key to your conections and how you can fix it. I am a beginner. So, ckeck again Mark's post, keep trying and good luck.

 

Kind regards,

Mike

Lorcan
Level: Powered On

Re: Google map and pin in PowerApps

Thanks Mike,

Yes I can get it to bring up other locations but not my own.
I have copied the exact URL's that Mark put in his explanations however I keep getting foreign locations.

Did you link your Google static API key inside your PowerApps Connections or not?

Regards
Lorcan

Mike8
Level 10

Re: Google map and pin in PowerApps

No I didn't. As I can see Mark's instructions don't have this step.

 

Kind regards,

Mike

Lorcan
Level: Powered On

Re: Google map and pin in PowerApps

Could you maybe just give me a quick explanation of what Mark meant by this:

LATER...
REPLACE all hard-coded references to a LAT/LONG with PowerApps "Location.Latitude" and "Location.Longitude", and you'll be capturing not only LAT/LONGs in your mobile app, but you'll have a nice image to CONFIRM you got the location right. 

After this I promise to leave you alone in peace Smiley Wink

Regards
Lorcan

CarlN
Level: Powered On

Re: Google map and pin in PowerApps

I Haven't tried this yet, but I assume mark meant something like this:

"https://maps.googleapis.com/maps/api/staticmap?center=" & Location.Latitude & "," & Location.Longitude & "&zoom=18&size=600x600&key=AIzaSyAF9Mh6B7EKgbSc_Riur9fodXwovTrfy38&markers=color:red%7Clabel:A%" & Location.Latitude & "," & Location.Longitude

Lorcan
Level: Powered On

Re: Google map and pin in PowerApps

CarlN!!!!!!! Mr. CarlN


I thank you sir. I have been struggling through many dark nights with this, I thank you.

And to you Mike. Many thanks gentlemen.

If you ever have any quesries please do let me know I may be able to assist!
HUGE SMILES right now! Smiley Very Happy

Cheers
Lorcan

Highlighted
AvenaFernando
Level: Powered On

Re: Google map and pin in PowerApps

This code works

 

"https://maps.googleapis.com/maps/api/staticmap?center=-22.41517,-46.973&zoom=20&size=640x240&key=MY-KEY&markers=color:red%7Clabel:A%7C-22.41517,-46.973"

 

Substituting: -22.41517, -46.973, for text fields, I had localization problem because I was in Brazil, Location.Latitude provided with -22,41517, with the function Text formatted the (,) by (.).

https://powerapps.microsoft.com/en-us/tutorials/function-text

 

But Location works perfectly on PowerApps Web (2.0.602) and Desktop (2.0.600), but on the Android (PowerApps Mobile: 2.0.600) mobile phone, it works, but after opening and closing the application it has not worked anymore.

 

I created buttons that Disable(Location) and Enable(Location)

 

https://powerapps.microsoft.com/en-us/tutorials/signals/

https://powerapps.microsoft.com/en-us/tutorials/function-enable-disable/

The Enable and Disable functions turn signal on and off, respectively.
These functions currently only work for the Location signal.

 

Attached is the application I made to use the Location function, placing Google's apikey on [MYKEY].

https://1drv.ms/u/s!AijLzG3PzbargXKnPyRVUDz4nT9c

 

It works on PowerApps Web and Desktop always, but on Mobile it works initially, but stops working without showing any error message.

 

Desktop

1pc-open-gps.jpg2pc-gps-disable.jpg2pc-gps-enable.jpg

 

 

 

 

 

 

 

 

 

 

 

 

Mobile

1mobile.png2mobile.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

How to work perfectly and always on Mobile?

I do not know what else to do.


CarlN
Level: Powered On

Re: Google map and pin in PowerApps

Hi AvenaFernando,

 

I've had the same experience. We've previously also programmed Android (using Android Studio) and experienced problems accessing the Location services.

On the newer Android OS's, one actually has to access location information through Google Play services rather than directly from the location services. This is "a known" issue on android, and I can only think that the Powerapps implementation is to access loaction services directly, which would give exactly this result (i.e. not updating the loations correctly: initially the locations come through correctly, and then it seems to "Freeze", always returning the same location). Interestingly, you don't get an error when accessing the Location Services directly, it just doesn't return accurate/valid locations...

 

I feel this is something that MS should look into...

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 179 members 3,293 guests
Please welcome our newest community members: