Is it possible that I can find location name according to Latitude and Longitude?
Solved! Go to Solution.
Yes, you can use the Bing Maps connector to do that. You'll need to register for a Bing Maps account at https://www.bingmapsportal.com/, where you'll get an API key to be able to "talk" to that API. Once you have it, you can add a Bing Maps connector to your app, and once you have it, you'll be able to use its GetLocationByPoint function to retrieve the location name.
For example, if you set the OnSelect property of a button to the following formula:
Set(myLocation, BingMaps.GetLocationByPoint(Location.Latitude, Location.Longitude))
Then once you click the button, you should be able to get the location name by using the name property of the myLocation variable:
myLocation.name
Notice that you don't need to use a button - you can also set that expression in the app's OnStart (or a screen OnVisible) property, and the location name will be available without the need for the user's interaction.
Yes, you can use the Bing Maps connector to do that. You'll need to register for a Bing Maps account at https://www.bingmapsportal.com/, where you'll get an API key to be able to "talk" to that API. Once you have it, you can add a Bing Maps connector to your app, and once you have it, you'll be able to use its GetLocationByPoint function to retrieve the location name.
For example, if you set the OnSelect property of a button to the following formula:
Set(myLocation, BingMaps.GetLocationByPoint(Location.Latitude, Location.Longitude))
Then once you click the button, you should be able to get the location name by using the name property of the myLocation variable:
myLocation.name
Notice that you don't need to use a button - you can also set that expression in the app's OnStart (or a screen OnVisible) property, and the location name will be available without the need for the user's interaction.
Thank you so much! It worked!
Hi CarlosFigueira,
Just tried this and it works like a charm in the powerapps web studio (I've setup an Azure Enterprise API - free version). I used it on the OnStart so when I open the app in the web studio it loads the Country in a variable (Set(myLocation, BingMaps.GetLocationByPoint(Location.Latitude, Location.Longitude).address.countryRegion))
Now when I try to open the app in play mode (on the laptop or on my smartphone), this variable is not populated.
Are you aware of this issue? Or did I overlook something?
Thanks,
Gert
Hello, I tried your recommendation but I could not get my county.
When I write this code(BingMaps.GetLocationByPoint(Location.Latitude; Location.Longitude).name), I am just getting the latitude and longitude values, however I want my county to return.
thanks in advance.
I believe you're having the same issue as in this thread: given that you're using ';' to separate the parameters to that function, I'm guessing the locale you're running uses ',' as the decimal separator by default. The Bing Maps API needs the latitude and longitude values to be passed using '.' as the decimal separator, so if you change your expression to the following, it should work.
BingMaps.GetLocationByPoint( Text(Location.Latitude; "[$-en-US]0.0000000"; "en-US"); Text(Location.Longitude; "[$-en-US]0.0000000"; "en-US")).name
Hello @CarlosFigueira,
Thanks for help. It worked, but it returns following statement:
"Londra Asfaltı Caddesi 92C, 34"
I want it to return as "Buyukcekmece".
How can I do it?
Thanks a lot.
Hi,
Can you provide some guidance to do this using google maps API for reverse geocoding?
To get the Country or region name of current user you need to use:
BingMaps.GetLocationByPoint(Location.Latitude, Location.Longitude).address.countryRegion
Check detailed get location response properties at: Bing Maps Connector
Hi @CarlosFigueira ,
I have used the same formula on my App OnStart, but I am only getting my City and my country name in the label,
I want to have the complete address from the coordinates any help??
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
199 | |
72 | |
50 | |
42 | |
30 |
User | Count |
---|---|
266 | |
121 | |
94 | |
90 | |
81 |